Hi Jacob, Thanks for your reply.
- hibernate3.jar - does not contain log4j.properties or log4j.xml file - the modified log4j.properties file is first placed under the Java source folder, and upon building with Ant, it gets moved to the /WEB-INF/classes/ folder , immediately under /classes , I looked at the log4j.properties under classes and it is the modified version (supposed to log to a file and not std out) - C:\dev\tomcat\apache-tomcat-5.5.20\shared\lib\log4j.jar , and similar corresponding location in Unix as well. (this is where the project team placed it originally) - Hibernate library is under /WEB-INF/lib/ folder of the project - log4j.jar is in the shared folder, hibernate3.jar is in the project folder and log4j.properties is in the project's classes folder. I was told that there is another log4j.properties on the Unix machine, perhaps that properties file is conflicting with the log4j.properties I have in the classes folder. At least it is good to know that the log4j.properties has been configured properly, now I'll check to see if there are any conflicting property files. Thanks a lot for the suggestions, I will take a look at this. -Regards Rashmi ----- Original Message ---- From: Jacob Kjome <[EMAIL PROTECTED]> To: Log4J Users List <[email protected]> Sent: Friday, March 2, 2007 12:32:48 PM Subject: Re: Newbie trying to change Standard Output log to File log 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] ____________________________________________________________________________________ Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
