even if this configuration gets picked up, it won't create the file. No appenders are referenced anywhere.
Douglas E Wegscheid Lead Technical Analyst, Whirlpool Corporation (269)-923-5278 "A wrong note played hesitatingly is a wrong note. A wrong note played with conviction is interpretation." "Jacob Kjome" <h...@visi.com> 05/26/2010 02:19 PM Please respond to "Log4J Users List" <log4j-user@logging.apache.org> To "Log4J Users List" <log4j-user@logging.apache.org> cc Subject Re: Logging some packages to File First, I would set "log4j.rootCategory" to "INFO" or "WARN" and lower the threshold as needed for the stuff you are interested in (which you have done, but was unnecessary as long as you set the root category/logger to "DEBUG"). If you are not seeing the log file get created, then your properties file is probably not getting picked up. Note that if "log4j.xml" is found on the classpath, it will be used in preference to "log4j.properties". Also, it depends where your log4j.jar is located. If log4j.jar exists in the server classpath, it will never see your config file in WEB-INF/classes. Besides, if log4j is used at the server level, the server (and all apps in it) will use the same logger repository (unless you install a repository selector, which is another conversation), resulting in configuration being performed exactly once at server startup, not application startup. What I suggest is setting the following system property, which will print information to the console showing you which config file is being loaded.... -Dlog4j.debug=true Once you have determined that, you will be able to take corrective action. Jake On Wed, 26 May 2010 06:02:30 -0700 (PDT) fmarchioni <f.marchi...@pride.it> wrote: > > Hi all ! > I have the need to write logs from some packages in a file so I have > elaborated this log4j.properties file : > > log4j.rootCategory=DEBUG > > #I want to log information from packages hibernate.objects.* and from > iceObjects.* > log4j.category.hibernate.objects=INHERITED,A2 > log4j.category.iceObjects=INHERITED,A2 > > #I want to log statements with DEBUG or higher level > log4j.category.hibernate.objects=DEBUG > log4j.category.iceObjects=DEBUG > > log4j.appender.A1=org.apache.log4j.ConsoleAppender > log4j.appender.A1.layout=org.apache.log4j.PatternLayout > log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n > > > log4j.appender.A2=org.apache.log4j.RollingFileAppender > log4j.appender.A2.File=/u02/oracle/user_projects/domains/NMS/application.log > log4j.appender.A2.layout=org.apache.log4j.PatternLayout > log4j.appender.A2.layout.ConversionPattern=%p %t %c - %m%n > log4j.appender.A2.MaxFileSize=500KB > > > The packages I'm interested to log are those beginning with iceObjects.* and > hibernate.objects.* > I've put this log4j.properties file in the WEB-INF/classes folder and > deployed the web application on Oracle Weblogic. > > However the log file application.log is never created. Can anybody give me a > hint ? is the file correct ? > thanks a lot >Federico > -- > View this message in context: >http://old.nabble.com/Logging-some-packages-to-File-tp28680496p28680496.html > Sent from the Log4j - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org >For additional commands, e-mail: log4j-user-h...@logging.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org