Does HIbernate package log4j.properties in their library? Where do you put your modified log4j.properties? Log4j auto-configures itself in a static initializer and looks first for log4j.xml and then log4j.properties (if the former isn't found) in the default package. Are you sure your modified version is being found instead of the unmodified version (or even some other Log4j config file in the classpath)? Where do you put log4j.jar? Where do you put the hibernate library? Are hibernate.jar and log4j.jar in a shared classloader or in WEB-INF/lib? Is your config file in WEB-INF/classes or a shared location?

These are all things to look into. I would hasten to bet that your modified config file is not being utilized. By answering the questions above, and thinking about how classloaders work (taking into account Tomcat's child-first webapp classloader), you should be able to solve the issue.

Jake

At 11:08 AM 3/2/2007, you wrote:
>Hello Everyone,
>
>I'm new to Log4J. I think we're using Log4J version 1.2.8.
>On Tomcat 5.5
>
>I am using the basic Log4J properties file that comes with Hibernate
>Version 3.3.2 distribution:
>
>By default the properties file is configured to send the output to the console
>
>Here's what came with Hibernate:
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>### 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
>
>### direct messages to file hibernate.log ###
>#log4j.appender.file=org.apache.log4j.FileAppender
>#log4j.appender.file.File=hibernate.log
>#log4j.appender.file.layout=org.apache.log4j.PatternLayout
>#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
>
>### set log levels - for more verbose logging change 'info' to 'debug' ###
>
>log4j.rootLogger=warn, 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
>
>### log JDBC bind parameters ###
>log4j.logger.org.hibernate.type=info
>#log4j.logger.org.hibernate.type=debug
>
>### log schema export/update ###
>log4j.logger.org.hibernate.tool.hbm2ddl=debug
>
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>Then, I made changes to the above properties file, to make the output
>be logged in a file instead
>of standard output.
>
>as follows upon searching on Google (but the output of the log still
>goes to standard output instead of a file)
>
>### 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
>
>### direct messages to file hibernate.log ###
>log4j.appender.file=org.apache.log4j.FileAppender
>log4j.appender.file.File=hibernate.log
>log4j.appender.file.layout=org.apache.log4j.PatternLayout
>log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
>
>### set log levels - for more verbose logging change 'info' to 'debug' ###
>
>#log4j.rootLogger=warn, stdout
>log4j.rootLogger=warn, file
>
>#log4j.logger.org.hibernate=info
>log4j.logger.org.hibernate=info
>
>### log HQL query parser activity
>#log4j.logger.org.hibernate.hql.ast.AST=debug
>
>### log just the SQL
>#log4j.logger.org.hibernate.SQL=debug
>
>### log JDBC bind parameters ###
>#log4j.logger.org.hibernate.type=info
>log4j.logger.org.hibernate.type=debug
>
>### log schema export/update ###
>log4j.logger.org.hibernate.tool.hbm2ddl=debug
>
>I looked at the example here:
>http://ideoplex.com/id/386/controlling-hibernate-output-with-log4j to make the
>above change, but I'm confused as to why the log is still being
>directed to the console rather than hibernate.log file.
>
>I plan to read the Log4J manual and understand the various notations
>used in the properties file.
>
>Any help is appreciated.
>
>-Regards
>Rashmi
>
>
>
>
>
>______________________________________________________________________
>______________
>Never miss an email again!
>Yahoo! Toolbar alerts you the instant new Mail arrives.
>http://tools.search.yahoo.com/toolbar/features/mail/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to