Call :

appender.activateOptions();

:)


----- Original Message -----
From: "Marco Perrando" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 20, 2002 8:44 AM
Subject: Use of PropertyConfigurator


I need to initialize my log4j system by PropertyConfigurator. I need a
RollingFileAppender, but I know the file name only at runtime (actually it's
read from a ServletContext - InitParameter value).

So I call PropertyConfigurator.configure.... and after I set the file manually
with

((RollingFileAppender)Category.getRoot().getAppender("<theAppenderName>")).setFi
le("<theFileName>",true);

Everything goes ok, but I get the annoying WARN message out to the console

log4j:WARN File option not set for appender [<theAppenderName>].
log4j:WARN Are you using FileAppender instead of ConsoleAppender?

Everytime the servlet initializes the log4j system.

Is there any chance to avoid this annoying message?
Or even better.
Is there another way to initialize the RollingFileAppender directly into the
properties file, by accessing the InitParameter of my servlet context (IMO it's
impossible...)

Thank you!



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to