You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by T Master <tm...@iknowledge.com> on 2002/02/12 20:46:57 UTC
FallbackErrorHandler.setBackupAppender(null) throws NullPointerException
Not sure if this is the desired behaviour. The same will occur with the other
setter methods.
No I won't be doing this in my code...I was just testing for another issue
(QuietWriter.flush() threw a NullPointerException after changing my
FileAppender's directory to a disk with no space e.g. floppy - cannot repeat in
a junit test though)
It may be better to throw an IllegalArgumentException, or just to ignore the
parameter if null.
Code from log4j.varia.FallbackErrorHandler.java
/**
Set the backup appender.
*/
public
void setBackupAppender(Appender backup) {
LogLog.debug("FB: Setting backup appender to [" + backup.getName() + "].");
this.backup = backup;
}
Using log4jv1.2-beta2.
Regards,
T Master.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Can I do this with PropertyConfigurator?
Posted by Joe Polanik <jP...@cds.duke.edu>.
I'm using an initialization servlet with the following lines in the init()
method:
String logFile = config.getInitParameter("logPath");
String prefix = getServletContext().getRealPath("/");
System.out.println("prefix: " + prefix);
if (logFile != null) {
PropertyConfigurator.configure(prefix + "WEB-INF\\classes\\" +
logFile);
}
In web.xml the init parameter is defined as log4j.properties.
The servlet reads log4j.properties where it finds the following:
log4j.rootCategory=debug, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=arachneTest.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
The problem (as I see it) is that the output log ends up in
<Tomcat_Home>\bin, whereas I'd like it to be in <Tomcat_Home>\webapps\MyApp
(or some subdirectory of MyApp like 'log'). However any attempt to prepend
the filename in log4j.properties with path information generates a File Not
Found error.
Can this be done? If so, How????
Thanks in Advance for any ideas,
Joseph Polanik
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>