Hi, Run it inside a profiler to see where CPU time is spent. Yoav Shapira Millennium Research Informatics
>-----Original Message----- >From: Shriver, Derrick [mailto:[EMAIL PROTECTED] >Sent: Wednesday, May 19, 2004 4:09 PM >To: '[EMAIL PROTECTED]' >Subject: long initialization delay > >I'm getting a 2-5 minute delay when making the call to >PropertyConfigurator.configure(file) to initialize Log4j. I'm running >log4j-1.2.8 inside iPlanet 6.0, jdk 1.3.1, on Solaris. We have other apps >using this version of log4j on that same server and they don't have this >problem. This code sits within an initializer servlet. > >I've tried putting the config file in various places and get the same >result. I've also tried sending a properties file to configure() in hopes >that it was a parsing or URL resolution problem; no luck. And I've tried >completely rewriting the config file from scratch using a sample from >manual.html. > >Any suggestions as to why this is happening? Or even a way to figure out >what is happening or blocking during the delay? > >FWIW the code runs fine on my Windows JDK 1.3.1. > > > System.setProperty( "log4j.defaultInitOverride", "true" ); > String file = ( new File( this.getServletContext().getRealPath("/" >) > + File.separator + >"WEB-INF/classes/log4j.properties" )).getAbsolutePath(); > // if the log4j-init-file is not set, then no point in trying > if(file != null) { > org.apache.log4j.PropertyConfigurator.configure(file); > org.apache.log4j.Logger myLogger = >org.apache.log4j.Logger.getLogger( "R" ); > myLogger.debug( "SearchServiceInitializer.init(): logged through >myLogger" ); > } else { > throw new RuntimeException( "Log4j config file not found: " + >file ); > } > > >log4j.properties (taken directly from >http://logging.apache.org/log4j/docs/manual.html ) >------------------------------------------ >log4j.rootLogger=debug, stdout, R > >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 > >log4j.appender.R=org.apache.log4j.RollingFileAppender >log4j.appender.R.File=/tmp/example.log > >log4j.appender.R.MaxFileSize=100KB ># Keep one backup file >log4j.appender.R.MaxBackupIndex=1 > >log4j.appender.R.layout=org.apache.log4j.PatternLayout >log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n > >-------------------------------------------------------------------- >Thanks, >-Derrick > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]