Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 71665 invoked from network); 29 Jul 2004 15:08:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 29 Jul 2004 15:08:12 -0000 Received: (qmail 14469 invoked by uid 500); 29 Jul 2004 15:08:01 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 14346 invoked by uid 500); 29 Jul 2004 15:07:59 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 14324 invoked by uid 99); 29 Jul 2004 15:07:58 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [69.149.175.19] (HELO PSAUNIT.PSASOFT.COM) (69.149.175.19) by apache.org (qpsmtpd/0.27.1) with ESMTP; Thu, 29 Jul 2004 08:07:55 -0700 Received: from [192.168.1.17] ([192.168.1.17]) by PSAUNIT.PSASOFT.COM (Lotus Domino Release 5.0.4) with ESMTP id 2004072910074675:1073 ; Thu, 29 Jul 2004 10:07:46 -0500 Subject: not parsing properties file From: Robert Upshall Reply-To: rupshall@psasoft.com To: Log4J Users List Organization: PSA Message-Id: <1091113543.1747.4.camel@ru.psasoft.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Thu, 29 Jul 2004 10:05:43 -0500 X-MIMETrack: Itemize by SMTP Server on psaunit/psa(Release 5.0.4 |June 8, 2000) at 07/29/2004 10:07:47 AM, Serialize by Router on psaunit/psa(Release 5.0.4 |June 8, 2000) at 07/29/2004 10:07:53 AM, Serialize complete at 07/29/2004 10:07:53 AM Content-Type: multipart/mixed; boundary="=-fL9sRrTX4o4h4dIErOFY" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --=-fL9sRrTX4o4h4dIErOFY Content-Transfer-Encoding: 7bit Content-Type: text/plain I have 2 systems, both running the same test app with same test properties. One system works as expected but the other detects the correct log4j.properties but doesn't parse it. Here is the debug output from the failing system: > java testlog log4j: Trying to find [log4j.xml] using context classloader sun.misc.Launcher $AppClassLoader@7ee12106. log4j: Trying to find [log4j.xml] using sun.misc.Launcher$AppClassLoader@7ee1 2106 class loader. log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource(). log4j: Trying to find [log4j.properties] using context classloader sun.misc.L auncher$AppClassLoader@7ee12106. log4j: Using URL [file:/home/ru/log4j.properties] for automatic log4j configu ration. log4j: Reading configuration from URL file:/home/ru/log4j.properties log4j: Could not find root logger information. Is this OK? log4j: Finished configuring. log4j:WARN No appenders could be found for logger (testlog). log4j:WARN Please initialize the log4j system properly. $ I have attached the lo4j.properties and the source for the test app, does this make sense to anybody? --=-fL9sRrTX4o4h4dIErOFY Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=log4j.properties Content-Type: text/plain; name=log4j.properties; charset=ANSI_X3.4-1968 #### Use two appenders, one to log to console, another to log to a file log4j.rootCategory=debug, stdout, R # Print only messages of priority WARN or higher for your category #log4j.category.your.category.name=WARN # Specifically inherit the priority level #log4j.category.your.category.name=INHERITED #### First appender writes to console 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 #### Second appender writes to a file log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=example.log # Control the maximum log file size log4j.appender.R.MaxFileSize=100KB # Archive log files (one backup file here) log4j.appender.R.MaxBackupIndex=1 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n --=-fL9sRrTX4o4h4dIErOFY Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=testlog.java Content-Type: text/x-java; name=testlog.java; charset=ANSI_X3.4-1968 public class testlog { public static void main(String[] args) throws java.io.IOException { org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog( "testlog" ); log.info( "This is an info message" ); log.error( "This is an error message" ); log.debug( "This is a debug message" ); log.trace( "This is a trace message" ); } } --=-fL9sRrTX4o4h4dIErOFY Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org --=-fL9sRrTX4o4h4dIErOFY--