Ticket Q234241
Visible to All Users
Duplicate

Tracing - Write Log Messages to Database

created 15 years ago

Hi Guys,
currently the Tracer writes to an Textfile - in an MultiUser Environment this is not useable. Imagine you have 50+ Users - the only way the Administrator has is to look on the local machines logfile. I need a way to write the LogMessages into the Database - any Suggestions here? Recompiling XAF Sources is no way!
thx
Noxe

Answers approved by DevExpress Support

created 15 years ago (modified 11 years ago)

Hello Noxe,
Thanks for the question.
.NET Framework already allows you to do this. Just implement your own trace listener class that will write data into the database. As far as I know, there is no standard trace listener class that can do this. There are only simple text, xml and console trace listeners.
So, I suggest you continue from here: http://www.google.com/search?q=trace+listener&rls=com.microsoft:en-us&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1
The fact is that in XAF (the Tracing class) we use standard mechanisms provided by .NET Framework, and your own listener can be plugged in as in a regular .NET application.
Let me know if we can help you further with DX stuff.
Thanks,
Dennis

    Show previous comments (5)
    Dennis Garavsky (DevExpress) 8 years ago

      Thanks for sharing, Fitzroy!

      PP PP
      Patrick Pielarski 8 years ago

        Hi I have implemented my own trace listener  with log4net as suggested and it works fine.
        However the devexpress log file "eXpressAppFramework.log" is still created.

        If I configure the switch
        <add name="eXpressAppFramework" value="0"/>
        to zero the file is not created, but there are also no traces logged to the trace listener obviously.

        So how can one use a custom trace listener and prevent the defult log file from creating?

        Dennis Garavsky (DevExpress) 7 years ago

          @Patrick: We'll answer you in the separate ticket: XAF Logging with log4net. Thanks for creating it.

          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.