Ticket T355681
Visible to All Users

Core - Provide an option to override the Tracing class behavior

created 9 years ago (modified 9 years ago)

Hello DX,

I'm using a 3rd party logging system for my application. Currently I successfully capture both the XAF and XPO trace log in it. However I would like to use the more advanced features (category, objects and param storing, etc.) For example it can store the exception object and not just the exception text message.

I started investigating the source of DevExpress.Persistent.Base .Tracing and was really happy to find virtual LogError, and other LogXXX methods that would fit my needs. However the Tracing class is a singleton and it 'initilize' instances itself in the constructor instead of a virtual factory, so basically there's no way (that I see) to override the tracer with my descendant. Is there a way I derive Tracing and use it to log XAF tracing?

Thanks,

Alex

Show previous comments (1)
DevExpress Support Team 9 years ago

    Hello Alex,

    Would you mind making this ticket public so that it can be available for other customers?

      You guys are simply the best! Thanks for the super fast implementation! @Konstantin, no problem make it public.

      DevExpress Support Team 9 years ago

        Welcome!

        Answers approved by DevExpress Support

        created 9 years ago (modified 8 years ago)

        We have implemented the functionality described in this ticket. It will be included in our next update(s).

        Please check back and leave a comment to this response to let us know whether or not this solution addresses your concerns.

        Additional information:

        The CreateCustomTracer static event has been added to the DevExpress.Persistent.Base.Tracing class. This event occurs each time a Tracing instance is created. Handle this event to replace the default Tracing instance with a custom instance. For example, you can inherit the Tracing class and override its virtual LogError, LogText, LogLoadedAssemblies and other virtual methods to implement custom logging.

        See Also:
        Concepts > Debugging and Error Handling > Add Custom Log Entries and Customize the Default Tracer Behavior
        Tracing - How to exclude loaded assemblies from the eXpressAppFramework.log file
        How to replace XAF exception handling with Logify

          Show previous comments (9)
          Aleksei M. (DevExpress) 9 years ago

            Hello Alexandre,

            > I figured I was becoming a little annoying with all the change requests on this class.

            Your feedback is very valuable for us. We will try to make necessary changes as soon as possible to make this class more convenient for utilization.

              Hi Aleks,

              I just installed the latest 16.2 beta and found the little surprise. Thanks for making all the changes I requested! Everything is working perfectly now.

              You guys are the best!

              Alex

              AG AG
              Alex Gn (DevExpress) 9 years ago

                You are always welcome!

                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.