4 Feb 2009 15:44
Re: Strange behaviour of log4j
Jacob Kjome <hoju <at> visi.com>
2009-02-04 14:44:56 GMT
2009-02-04 14:44:56 GMT
Whether the behavior is "strange" or not depends on how you are configuring Log4j and how the classloader hierarchy is set up under OC4J... as well as where Log4j.jar exists in the classloader hierarchy. I'm guessing you are letting Log4j auto-configure itself by finding your log4j.properties in the classpath. If Log4j is in the OC4J classpath, I would only expect this to happen once, which would set up a single logger repository (the default one) which all applications would use. Rather than speculate anymore about what could possibly be happening, I'll let you describe you setup in greater detail. We'll be able to draw more precise conclusions from that. Jake On Tue, 3 Feb 2009 23:36:51 -0800 (PST) yankings <yankings <at> hotmail.com> wrote: > > Hi, > > I have deployed two applications into same OC4J instance, the version of > OC4J is 10.1.3.1. > > The strange thing is the second applications will ignore it's oc4j > properties, and use the first applications log4j.propeties, here is the > log4j.properties in this two application: > > log4j.properties in first application >> > log4j.rootLogger=info, MAIL, R > > log4j.appender.stdout=org.apache.log4j.ConsoleAppender > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout > > log4j.appender.stdout.layout.ConversionPattern=%d [%t] %5p (%F:%L) - %m%n > > log4j.appender.R=org.apache.log4j.DailyRollingFileAppender > log4j.appender.R.File=/test/test.log > log4j.appender.R.DatePattern = '.'yyyy-MM-dd > > log4j.appender.R.MaxFileSize=100KB > log4j.appender.R.MaxBackupIndex=1 > > log4j.appender.R.layout=org.apache.log4j.PatternLayout > log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n > > log4j.appender.MAIL=org.apache.log4j.net.SMTPAppender > log4j.appender.MAIL.BufferSize=1 > log4j.appender.Mail.Threshold =info > log4j.appender.MAIL.SMTPHost=smtphost.test.com > log4j.appender.MAIL.From=testuser <at> test.com > log4j.appender.MAIL.to=testuser <at> test.com > log4j.appender.MAIL.Subject=Testing Error Alert > log4j.appender.MAIL.layout=org.apache.log4j.PatternLayout > log4j.appender.MAIL.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n > > > log4j.properties in second application >> > log4j.rootLogger=info, MAIL, R > > log4j.appender.stdout=org.apache.log4j.ConsoleAppender > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout > > log4j.appender.stdout.layout.ConversionPattern=%d [%t] %5p (%F:%L) - %m%n > > log4j.appender.R=org.apache.log4j.DailyRollingFileAppender > log4j.appender.R.File=/test/test2.log > log4j.appender.R.DatePattern = '.'yyyy-MM-dd > > log4j.appender.R.MaxFileSize=100KB > log4j.appender.R.MaxBackupIndex=1 > > log4j.appender.R.layout=org.apache.log4j.PatternLayout > log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n > > log4j.appender.MAIL=org.apache.log4j.net.SMTPAppender > log4j.appender.MAIL.BufferSize=1 > log4j.appender.Mail.Threshold =info > log4j.appender.MAIL.SMTPHost=smtphost.test.com > log4j.appender.MAIL.From=testuser2 <at> test.com > log4j.appender.MAIL.to=testuser2 <at> test.com > log4j.appender.MAIL.Subject=Testing Error Alert > log4j.appender.MAIL.layout=org.apache.log4j.PatternLayout > log4j.appender.MAIL.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n > -- > View this message in context: >http://www.nabble.com/Strange-behaviour-of-log4j-tp21825741p21825741.html > Sent from the Log4j - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org >For additional commands, e-mail: log4j-user-help <at> logging.apache.org > >
RSS Feed