One thing that's "unusual" - using the root logger. It's generally recommended to use the getLogger method and name your loggers with the class FQCN, else you lose much of the power of Log4j (see http://logging.apache.org/log4j/docs/manual.html).
Q: did you see the console output, and did you not see the output in the file or did you not find the file? -----Original Message----- From: Javier [mailto:[EMAIL PROTECTED] Sent: Thursday, November 11, 2004 9:44 AM To: [EMAIL PROTECTED] Subject: Can4t write logs Hello I?m using log4j by the first time. I did the following properties file: ---------------- # Set root logger level to DEBUG and its only appender to A1. log4j.rootLogger=INFO, stdout, A1 # A1 is set to be a ConsoleAppender. log4j.appender.A1=org.apache.log4j.RollingFileAppender log4j.appender.A1.File=apliA.log log4j.appender.A1.maxFileSize=1MB log4j.appender.A1.maxBackupIndex=3 # A1 uses PatternLayout. log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%p %t %c - %m%n # stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n ------------ and in my code I did: PropertyConfigurator pcconfig = new PropertyConfigurator(); pcconfig.configure("aprop.properties"); logger = Logger.getRootLogger(); logger.info("Entering application."); but when I run the application, I saw "entering aplication" was not wrote in log file... What am I doing wrong ? Thanks in advance Javier __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ------------------------------------------------------------------------------- This message and any included attachments are from Siemens Medical Solutions USA, Inc. and are intended only for the addressee(s). The information contained herein may include trade secrets or privileged or otherwise confidential information. Unauthorized review, forwarding, printing, copying, distributing, or using such information is strictly prohibited and may be unlawful. If you received this message in error, or have reason to believe you are not authorized to receive it, please promptly delete this message and notify the sender by e-mail with a copy to [EMAIL PROTECTED] Thank you --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
