Results 1 to 5 of 5

Thread: log4j debug level

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    3

    Default log4j debug level

    Hi

    I'm using spring 3.0.5 and spring security 3.0.5 with log4j for logging. How can i set the level of debugging of spring to DEBUG?

    I set in my log4.properties

    log4j.logger.org.springframework=DEBUG

    but the level also remain to INFO.

    Thanks for your help

  2. #2
    Join Date
    Aug 2008
    Location
    Phoenix, AZ
    Posts
    76

    Default

    i would ask to post the log4j config you're using so we can see...
    i also wonder whether it's really getting picked up by spring... is it at the root of the classpath? can you verify other changes to the logging file are being picked up?
    Enterprise Software Consultant
    http://www.christianposta.com/blog

  3. #3
    Join Date
    Dec 2010
    Posts
    3

    Default

    Hi

    This is my log4j.properties file. I put it in WEB-INF folder. At the stdout i see only INFO level (es.
    46723 [btpool0-0] INFO org.springframework.security.access.event.LoggerLi stener - Security authorized for authenticated ....
    )

    ### direct log messages to stdout ###
    log4j.appender.stdout=org.apache.log4j.ConsoleAppe nder
    log4j.appender.stdout.Target=System.out
    log4j.appender.stdout.layout=org.apache.log4j.Patt ernLayout
    log4j.appender.stdout.layout.ConversionPattern=%d{ ABSOLUTE} %5p %c{1}:%L - %m%n
    ### set log levels - for more verbose logging change 'info' to 'debug' ###
    log4j.rootLogger=debug, stdout
    log4j.logger.org.hibernate=info
    #log4j.logger.org.hibernate=debug
    ### log HQL query parser activity
    #log4j.logger.org.hibernate.hql.ast.AST=debug
    ### log just the SQL
    log4j.logger.org.hibernate.SQL=debug

    log4j.logger.org.springframework=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
    ### enable the following line if you want to track down connection
    ###### leakages when using DriverManagerConnectionProvider ####
    log4j.logger.org.hibernate.connection.DriverManage rConnectionProvider=trace

    Thanks for your help

  4. #4
    Join Date
    Aug 2008
    Location
    Phoenix, AZ
    Posts
    76

    Default

    How are you loading the log4j.properties? Are you loading it somewhere in a context listener? Or are you just hoping the default behavior will pick it up?
    If you're hoping for default, it should be on the root of the classpath (for example, if you put it into the /WEB-INF/classes directory, it would be on the root of the classpath).
    Enterprise Software Consultant
    http://www.christianposta.com/blog

  5. #5
    Join Date
    Dec 2010
    Posts
    3

    Default

    I have log4j.properties file in WEB-INF folder.

    I also insert the line

    <listener>
    <listener-class>org.springframework.web.util.Log4jConfigList ener</listener-class>
    </listener>
    <context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>/WEB-INF/log4j.properties</param-value>
    </context-param>

    in web.xml file.

    Is the line

    log4j.logger.org.springframework=DEBUG

    correct for Spring 3.0?


    Thanks for your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •