2 Replies Latest reply on Dec 14, 2011 10:52 AM by rosanero4ever

    Enable logging on Jboss 6.0

    rosanero4ever Newbie

      Hi all,

      I use Jboss AS 6.0 and i would like enable logging for my little web application that uses ejb3 and hibernate 2.0 as persistence provider. I read many posts about enabling hibernate logging but actually i can't see any log :-( I create a log4j.properties file and I put it in the root folder of my Netbeans project. I put also log4j library in the classpath of the project. My log4j.properties s the following:

      ### direct log messages to stdout ###
      log4j
      .appender.stdout=org.apache.log4j.ConsoleAppender
      log4j
      .appender.stdout.Target=System.out
      log4j
      .appender.stdout.layout=org.apache.log4j.PatternLayout
      log4j
      .appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L %m%n


      log4j
      .rootLogger=debug, stdout

      log4j
      .logger.org.hibernate=info

      ### log just the SQL
      log4j
      .logger.org.hibernate.SQL=debug

      ### log JDBC bind parameters ###
      log4j
      .logger.org.hibernate.type=info

      ### log schema export/update ###
      log4j
      .logger.org.hibernate.tool.hbm2ddl=info

      ### log HQL parse trees
      #log4j.logger.org.hibernate.hql=debug

      ### log cache activity ###
      log4j
      .logger.org.hibernate.cache=info

      ### log transaction activity
      #log4j.logger.org.hibernate.transaction=debug

      ### log JDBC resource acquisition
      #log4j.logger.org.hibernate.jdbc=debug

      Why can't I see the log informations? I would like see values in sql WHERE clauses or in INSERT statements (actually I see only some '?') I read some articles about jboss-logging.xml but I don't know I should set it.

      I hope somebody can help me. Thanks in advance

        • 1. Re: Enable logging on Jboss 6.0
          Wolf-Dieter Fink Master

          What you want to achieve?

          If you want see logging on the server side edit server/<your profile>/deploy/jboss-logging.xml.

          Search for 'hibernate' activate it and set to the Level you want.

           

          For your applicaiton add a logger category for your classes.

           

          The logging on console is limited to INFO, the full logging is in the file server/<your profile>/log/server.log

          1 of 1 people found this helpful
          • 2. Re: Enable logging on Jboss 6.0
            rosanero4ever Newbie

            Great!

            I edited jboss-logging.xml as you wrote, i.e. setting

            <logger category="org.hibernate">

                 <level name="TRACE" />

               </logger>

             

            but I put my attention at the console and not at the log file!!!!!!!

            I lost many hours for this stupid problem!

            Thank you very much for your precious help