[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4j-user
Subject:    RE: log4j:ERROR Attempted to append to closed appender named
From:       Costa Basil <costa_basil () yahoo ! ca>
Date:       2006-02-22 0:02:00
Message-ID: 20060222000200.39942.qmail () web50615 ! mail ! yahoo ! com
[Download RAW message or body]


I think I fixed it. The problem was that log4j was accessed before the call to \
PropertyConfigurator.configureAndWatch by the Myfaces StartupServletContextListener \
class. I added my own ServletContextListener that extends \
StartupServletContextListener and I initialize log4j before I call \
super.contextInitialized to initialize myfaces. No more error messages.

Kamal Ahmed <KAhmed@webMethods.com> wrote: Try using:
.activateOptions();
Right after you set the properties of the appender, like name, layout .. etc

-Kamal.

-----Original Message-----
From: Costa Basil [mailto:costa_basil@yahoo.ca] 
Sent: Tuesday, February 21, 2006 4:19 PM
To: log4j-user@logging.apache.org
Subject: log4j:ERROR Attempted to append to closed appender named 

I have been using log4j for a long time and until now I never had any
problem. However, currently I am using Weblogic 9.1 with jdk 1.5 and log4j
1.2.13 in a web application and I started to get the dreaded 'log4j:ERROR
Attempted to append to closed appender named...' errors and I don't
understand why.

Log4j is initialized in a setup servlet where I call
PropertyConfigurator.configureAndWatch(logConfigFileName). The log4j jar
file is deployed with the web application and it is not added the weblogic
system path. 

log4j is configured using a properties file (sitting on the file system)
that I've used for ages without any problem. But now the problem is that
after I modify the properties file I get a whole slew of 'log4j:ERROR
Attempted to append to closed appender named...' errors which I never got
before when I used weblogic 8.1sp4 (jdk 1.4).

I don't know if it helps but here is the content of the properties file:

log4j.rootLogger=info, A02, CA


#define the logger for the datamaintenance package

log4j.logger.package1=debug, A02, CA
log4j.additivity.package1=false

log4j.logger.package2=debug, A02, CA
log4j.additivity.package2=false


#define the appender that will be used by the two packages as well as root

#log4j.appender.A02=org.apache.log4j.ConsoleAppender
log4j.appender.A02=org.apache.log4j.FileAppender
log4j.appender.A02.File=logs/log_file.log
log4j.appender.A02.layout=org.apache.log4j.PatternLayout
log4j.appender.A02.layout.ConversionPattern=%d %p %x %l %t %m %n


log4j.appender.CA=org.apache.log4j.ConsoleAppender
log4j.appender.CA.layout=org.apache.log4j.PatternLayout
log4j.appender.CA.layout.ConversionPattern=%d %p %x %l %t %m %n


Can someone please explain why is this happening and if there is any fix?

Thanks
  
---------------------------------
Find your next car at Yahoo! Canada Autos

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org



		
---------------------------------
Find your next car at Yahoo! Canada Autos



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic