Ticket Q304721
Visible to All Users

Tracing - How to customize the eXpressAppFramework.log file generation and other aspects of the default tracer behavior

created 14 years ago

it comes out that when size of the fize eXpressAppFramework.log reaches some (strange) big values , all the project hangs
i need to stop webserver , delete eXpressAppFramework.log and then it works ok
is there a way to make data , being written to one eXpressAppFramework.log , be stored in separate files ?
for example every day there cound be created eXpressAppFramework-yyyy-mm-dd.log file
how can i make it work this way ?

Answers

created 14 years ago (modified 6 years ago)

Hello,

Our tracing mechanism relies on the standard .NET Framework logging APIs from the System.Diagnostics and related namespaces. By default, we use the TextWriterTraceListener class that writes all application events into the eXpressAppFramework.log file by means of our helper DevExpress.Persistent.Base.Tracing  class. The latter is technically a wrapper above the standard trace listeners . You can learn more on this from eXpressApp Framework > Concepts > Debugging and Error Handling > Log Files.

That said,  there are two general directions on how to implement logging customizations like splitting a single log into separate files or writing the trace output into the database (I am afraid we do not currently provide ready examples or guidelines for these general programming tasks):
1. Implement a fully custom TraceListener class descendant (or use any ready listener like CircularTraceListenerRollingXmlWriterTraceListener or more complex third-party solutions like log4net (check XAF integration example code in Q234241)) and plug-it into your .NET app as described in the corresponding MSDN documentation. See how to replace the built-in Trace Listener in the Redirect Trace ticket. This approach is more preferred and can be easier to implement.
     OR
2. Implement a fully custom Tracing class descendant and override its LogError, LogWarning, LogText, LogVerboseText, LogSetOfStrings, LogValue and other methods as you require. Refer to the eXpressApp Framework > Concepts > Debugging and Error Handling > Add Custom Log Entries and Customize the Default Tracer Behavior article for more details.
For certain tasks, it may also be sufficient to handle the NeedContextInformation and CustomFormatDateTimeStamp events without inheritance.

See Also:
How to replace XAF exception handling with Logify

Thanks,
Dennis

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.