7 Replies Latest reply on Oct 23, 2012 5:53 PM by sivajd

    Is Custom Logging Approach still valid ?

    sivajd

      https://docs.jboss.org/author/display/teiid81final/Custom+Logging

       

      Is the approach of custom logging mentioned at the above URL still valid ?

       

      In Jboss AS 7.1.1.Final the logging is completely based on JULI (java.util.Logging) as per the documentation at the following URL.

      https://docs.jboss.org/author/display/AS71/Logging+Configuration#LoggingConfiguration-logger

       

      The information mentioned at the teiid logging URL is based on log4J logging approach which I believe is no longer applicable. If what I say is correct, Could you all suggest what is the approach to extend the  CommandLogging and AuditLogging ?

      In case if my assumption is wrong, could you all please let me know how to configure the log4j logging in the standalone-configuration.xml ?

      Thanks for your help in advance. 

       

      regards

      -Siva

        • 1. Re: Is Custom Logging Approach still valid ?
          rareddy

          Siva,

           

          You are right. It may not work 8.x. I need to do some investigation as to what is right approach for 8.2. I will let you know.

           

          Ramesh..

          • 2. Re: Is Custom Logging Approach still valid ?
            rareddy

            I looged this issue and added some workarounds https://issues.jboss.org/browse/TEIID-2267

             

            Ramesh..

            • 3. Re: Is Custom Logging Approach still valid ?
              sivajd

              Ramesh,

               

              In the log4j version when we extended the AppenderSkeleton as CustomAppender, in the  "protected void append(LoggingEvent event)" method, we could get a handle to the CommandLogMessage class. Look at https://docs.jboss.org/author/display/teiid81final/Custom+Logging

              There we had an option to log the information available in the CommandLogMessage instance. CommandLogMessage class had the complete context information available and we could log what ever we want. In the new approach that you mentioned we do not get access to the CommandLogMessage instance but we get a handle to the serialized (based on toString() method) instance  of CommandLogMessage class. When we do not have handle to the CommandLogMessage then we have lost quite a bit of the context information. In the current situation, what should be our approach to get the same information ?

               

              In the current situation when we extend Handler we have access to java.util.logging.LogRecord (org.jboss.logmanager.ExtLogRecord at runtime). The ExtLogRecord has the NDC and MDC  available, where the context information can be captured and made available for the someone extending the Handler class to log the information. Is it possible for you all to make this available as a fix for the current version ? If you cannot provide a fix, Is it possible for you to suggest a mechanism / approach / solution where we could get the same info ?

               

              Appreciate your help very much. 

               

              Thanks

              Siva

              • 4. Re: Is Custom Logging Approach still valid ?
                rareddy

                In the log4j version when we extended the AppenderSkeleton as CustomAppender, in the  "protected void append(LoggingEvent event)" method, we could get a handle to the CommandLogMessage class. Look at https://docs.jboss.org/author/display/teiid81final/Custom+Logging

                There we had an option to log the information available in the CommandLogMessage instance. CommandLogMessage class had the complete context information available and we could log what ever we want. In the new approach that you mentioned we do not get access to the CommandLogMessage instance but we get a handle to the serialized (based on toString() method) instance  of CommandLogMessage class. When we do not have handle to the CommandLogMessage then we have lost quite a bit of the context information. In the current situation, what should be our approach to get the same information ?

                 

                This is in the earlier version of Teiid like 7.7 right?

                • 5. Re: Is Custom Logging Approach still valid ?
                  sivajd

                  Ramesh,

                   

                  Current version where I am trying to implement this is JBoss AS 7.1.1.Final and Teiid - 8.1.0.Final.

                  Though the documentation at the following URL https://docs.jboss.org/author/display/teiid81final/Custom+Logging  says teiid81Final it is only applicable to Teiid 7.X versions and definitely not to 8.1.0.Final

                  Hope I am clear.

                   

                  Thanks

                  Siva

                  • 6. Re: Is Custom Logging Approach still valid ?
                    rareddy

                    I made required changes and updated the documentaion. The change will be available in the next release 8.2CR1 which will come out some time next week. https://docs.jboss.org/author/display/TEIID/Custom+Logging

                    • 7. Re: Is Custom Logging Approach still valid ?
                      sivajd

                      Ramesh,

                       

                      This change would be of tremendous help. Thank you for your prompt action and the alternative. This is mighty nice. I will try to get the nightly build tomorrow and try to check it out. Really appreciate your help.

                       

                      Thanks

                      Siva