10 Replies Latest reply on Oct 7, 2016 1:08 PM by James Perkins

    log level settings in Jberet

    kk31 Newbie

      How do we configure the log level to trace level  for jberet core libraries(core,se,support and batch api ).

      I know logging implementation in these liberaries  uses from jboss-logging-final.jar, but i dont know what is default settings are  and how can we increase log level for these libraries so that we can better understand whats going on under the covers.

       

      Thanks.

        • 1. Re: log level settings in Jberet
          Cheng Fang Master

          have you tried the standard Java logging configuration?

          • 2. Re: log level settings in Jberet
            kk31 Newbie

            yes I tried with standard configuration.   But it does provide little bit inside such as

            INFO: WELD-000900: 2.3.0 (Beta3)

            Oct 06, 2016 4:31:51 PM org.jboss.weld.environment.deployment.discovery.ReflectionDiscoveryStrategy processAnnotatedDiscovery

            INFO: WELD-ENV-000014: Falling back to Java Reflection for bean-discovery-mode="annotated" discovery. Add org.jboss:jandex to the classpath to speed-up startup.

            Oct 06, 2016 4:31:51 PM org.jboss.weld.bootstrap.WeldStartup startContainer

            INFO: WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.

            Oct 06, 2016 4:31:51 PM org.jboss.weld.interceptor.util.InterceptionTypeRegistry <clinit>

            WARN: WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled

            Oct 06, 2016 4:31:51 PM org.jboss.weld.interceptor.util.InterceptionTypeRegistry <clinit>

            WARN: WELD-001700: Interceptor annotation class javax.ejb.PrePassivate not found, interception based on it is not enabled

            Oct 06, 2016 4:31:53 PM org.jberet.support.io.CsvItemWriter open

            INFO: JBERET060501: Opening resource MyBatchletTest_test.txt in class org.jberet.support.io.CsvItemWriter

            Oct 06, 2016 4:32:12 PM org.jberet.support.io.CsvItemWriter close

            INFO: JBERET060502: Closing resource MyBatchletTest_test.txt in class org.jberet.support.io.CsvItemWriter

             

             

             

            But i would like to set the level to traceof so that i can get more granular information such as  open() in csvItemWriter.

             

              SupportLogger.LOGGER.tracef("Open CsvItemWriter with checkpoint %s, which is ignored for CsvItemWriter.%n", checkpoint);

            • 4. Re: log level settings in Jberet
              James Perkins Master

              JBoss Logging is just a logging facade. By default JBeret Core will just use the java.util.logging.LogManager which looks to be the case from your log output. You'd need to configure the log manager. You can just use the -Djava.util.logging.config.file=logging.properties system property to configure JUL with a custom configuration. The logging.properties can be the full path to your configuration file.

               

              Here's an example configuration file that should show trace messages.

              .level=INFO
              org.jberet.support.level=FINEST
              
              handlers=java.util.logging.ConsoleHandler
              
              java.util.logging.ConsoleHandler.level=FINEST
              java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
              
              java.util.logging.SimpleFormatter.format=%1$tF-%1$tT %4$-6s [%3$s] %5$s%6$s%n
              

               

               

              If you don't want to use JUL, JBoss Logging also works with JBoss Log Manager, log4j, log4j2 and logback log managers.

               

              --

              James R. Perkins

              • 5. Re: log level settings in Jberet
                kk31 Newbie

                Thanks James. It worked for jberet-support jar.    I tried for jberet core and se jar files  like following , it says   " Can't set level for java.util.logging.ConsoleHandler"

                 

                org.jberet.level=FINEST

                org.jberet.se.level=FINEST

                org.jberet.support.level=FINEST

                • 6. Re: log level settings in Jberet
                  James Perkins Master

                  What is the value you have for java.util.logging.ConsoleHandler.level? Feel free to post your entire configuration file.

                   

                  --

                  James R. Perkins

                  • 7. Re: log level settings in Jberet
                    kk31 Newbie

                    here is my properties file

                     

                     

                    ############################################################
                    #   Global properties
                    ############################################################
                    # show messages at the INFO and above levels.
                    handlers= java.util.logging.ConsoleHandler
                    #handlers= java.util.logging.FileHandler
                    # To also add the FileHandler, use the following line instead.
                    #handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
                    
                    
                    # Default global logging level.
                    # Note that the ConsoleHandler also has a separate level
                    # setting to limit messages printed to the console.
                    .level= INFO
                    ############################################################
                    # Handler specific properties.
                    # Describes specific configuration info for Handlers.
                    ############################################################
                    # default file output is in user's home directory.
                    #java.util.logging.FileHandler.pattern = c:/eclipseoutput/u.log
                    #java.util.logging.FileHandler.limit = 50000
                    #java.util.logging.FileHandler.count = 1
                    #java.util.logging.FileHandler.level= ALL  
                    #java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
                    
                    
                    # Limit the message that are printed on the console to INFO and above.
                    java.util.logging.ConsoleHandler.level = FINEST  
                    java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
                    ############################################################
                    # Facility specific properties.
                    # Provides extra control for each logger.
                    ############################################################
                    # For example, set the com.xyz.foo logger to only log SEVERE messages:
                    #com.xyz.foo.level = SEVERE
                    org.jberet.level=FINEST
                    org.jberet.se.level=FINEST
                    org.jberet.support.level=FINEST 
                    
                    
                    
                    

                     

                     

                    Thanks

                    • 8. Re: log level settings in Jberet
                      James Perkins Master

                      Well that's really weird. Everything looks okay to me. The error would indicate the level, FINEST in your case, is invalid for the java.util.logging.ConsoleHandler. Though what you have looks correct. Look right above that message and see if there is another error message. Something like "Bad level value for property: java.util.logging.ConsoleHandler.level".

                       

                      --

                      James R. Perkins

                      • 9. Re: log level settings in Jberet
                        kk31 Newbie

                        This is the whole log that is getting printed in eclipse console.

                         

                         

                        Can't set level for java.util.logging.ConsoleHandler
                        Oct 07, 2016 11:50:06 AM org.jboss.weld.bootstrap.WeldStartup <clinit>
                        INFO: WELD-000900: 2.3.0 (Beta3)
                        Oct 07, 2016 11:50:07 AM org.jboss.weld.environment.deployment.discovery.ReflectionDiscoveryStrategy processAnnotatedDiscovery
                        INFO: WELD-ENV-000014: Falling back to Java Reflection for bean-discovery-mode="annotated" discovery. Add org.jboss:jandex to the classpath to speed-up startup.
                        Oct 07, 2016 11:50:07 AM org.jboss.weld.bootstrap.WeldStartup startContainer
                        INFO: WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
                        Oct 07, 2016 11:50:07 AM org.jboss.weld.interceptor.util.InterceptionTypeRegistry <clinit>
                        WARN: WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled
                        Oct 07, 2016 11:50:07 AM org.jboss.weld.interceptor.util.InterceptionTypeRegistry <clinit>
                        WARN: WELD-001700: Interceptor annotation class javax.ejb.PrePassivate not found, interception based on it is not enabled
                        Oct 07, 2016 11:50:08 AM org.jboss.weld.environment.deployment.discovery.ReflectionDiscoveryStrategy processAnnotatedDiscovery
                        INFO: WELD-ENV-000014: Falling back to Java Reflection for bean-discovery-mode="annotated" discovery. Add org.jboss:jandex to the classpath to speed-up startup.
                        Oct 07, 2016 11:50:08 AM org.jboss.weld.bootstrap.WeldStartup startContainer
                        INFO: WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
                        Oct 07, 2016 11:50:08 AM org.jberet.tx.LocalTransactionManager suspend
                        TRACE: JBERET000022: resume is not implemented for local transactions
                        Oct 07, 2016 11:50:08 AM org.jberet.repository.JdbcRepository insertJobInstance
                        DEBUG: JBERET000017: Persisted org.jberet.runtime.JobInstanceImpl@1b6 with id 438
                        Oct 07, 2016 11:50:08 AM org.jberet.repository.JdbcRepository insertJobExecution
                        DEBUG: JBERET000017: Persisted org.jberet.runtime.JobExecutionImpl@172 with id 370
                        Oct 07, 2016 11:50:08 AM org.jberet.repository.JdbcRepository insertStepExecution
                        DEBUG: JBERET000017: Persisted org.jberet.runtime.StepExecutionImpl@1353303f with id 367
                        In beforeStep of 367
                        Oct 07, 2016 11:50:08 AM org.jberet.tx.LocalTransactionManager setTransactionTimeout
                        TRACE: JBERET000022: setTransactionTimeout is not implemented for local transactions
                        Oct 07, 2016 11:50:08 AM org.jberet.support.io.CsvItemWriter open
                        TRACE: Open CsvItemWriter with checkpoint null, which is ignored for CsvItemWriter.
                        
                        
                        Oct 07, 2016 11:50:08 AM org.jberet.support.io.CsvItemWriter open
                        INFO: JBERET060501: Opening resource MyBatchletTest_test.txt in class org.jberet.support.io.CsvItemWriter
                        Oct 07, 2016 11:50:12 AM org.jboss.logging.DelegatingBasicLogger tracef
                        TRACE: About to write items, number of items 707, element type class java.util.ArrayList
                        
                        
                        Oct 07, 2016 11:50:12 AM org.jberet.support.io.CsvItemWriter close
                        INFO: JBERET060502: Closing resource MyBatchletTest_test.txt in class org.jberet.support.io.CsvItemWriter
                          READ_COUNT : 1197
                          ROLLBACK_COUNT : 0
                          FILTER_COUNT : 490
                          WRITE_SKIP_COUNT : 0
                          READ_SKIP_COUNT : 0
                          WRITE_COUNT : 707
                          PROCESS_SKIP_COUNT : 0
                          COMMIT_COUNT : 1
                        
                        • 10. Re: log level settings in Jberet
                          James Perkins Master

                          Weird. It does look like it's working though. The following appears to be a trace message not in the support logger.

                          1. Oct 07, 2016 11:50:08 AM org.jberet.tx.LocalTransactionManager suspend 
                          2. TRACE: JBERET000022: resume is not implemented for local transactions

                           

                          --

                          James R. Perkins