Tom -
Try this:
1) Make sure that log4j.jar is only in WEB-INF/lib.
2) Make sure that log4j.properties is only in WEB-INF/classes.
3) Make sure you are setting up tomcat correctly with the debug flag
properly.
On the command line, "set JAVA_OPTS=-Dlog4j.debug=true"
4) Create a new conte
Howdy,
Don't use the same name for a logger as you do for an appender: log4j is
fine with it but it's confusing to humans.
In the code I sent you I assumed your SMTP appender is attached to the
root logger. In the configuration below, it's not, so the SMTPsetup
variable is null. You can either
Here is a snippet of my properties file. I actually set up many files so I
only included the root and SMTP appender.
# This configuration illustrates filtering by logger name.
log4j.debug=false
log4j.rootLogger=DEBUG, ROOT
log4j.appender.ROOT=org.apache.log4j.FileAppender
log4j.appender.ROOT.lay
Howdy,
You need to access the SMTPAppender object and call its methods to
dynamically change the properties like the subject line.
How are you configuring log4j? If you know the name of the
SMTPAppender, e.g. "EmailAppender" this is pretty easy. In your class,
you would do something like:
Logg
Thorbjørn Ravn Andersen wrote:
I have a scenario where I would like to use log4j to save intermediate
XML-files for later debugging. We are using log4j 1.2.7, and it is
cumbersome to upgrade.
I therefore need a configuration that saves exactly one log entry per
log file, and names it with som
I have a scenario where I would like to use log4j to save intermediate
XML-files for later debugging. We are using log4j 1.2.7, and it is
cumbersome to upgrade.
I therefore need a configuration that saves exactly one log entry per
log file, and names it with some unique name.I tried
Daily
I'll start by letting everyone one know I am very new to Java (though I've
been in IT for 10yrs) and log4j so please excuse if this is a stupid
question.
I have been able to set up a test application using log4j to send email to
myself as a test for sending some logging information. The next step