SMTP log4j question

2003-11-18 Thread Miller,Catherine
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

Using log4j to log XML-files?

2003-11-18 Thread Thorbjørn Ravn Andersen
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

Re: Using log4j to log XML-files?

2003-11-18 Thread Thorbjørn Ravn Andersen
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

RE: SMTP log4j question

2003-11-18 Thread Shapira, Yoav
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:

RE: SMTP log4j question

2003-11-18 Thread Miller,Catherine
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

RE: SMTP log4j question

2003-11-18 Thread Shapira, Yoav
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

RE: Revamp: App-server independent log4j logging

2003-11-18 Thread Ken . Liu
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