RE: Tomcat log4j .

2003-12-17 Thread Ken . Liu
Just a suggestion, it would be a good idea to use a RollingFileAppender rather than logging everything to one big file. You'll have no problems deleting the files that have rolled over. > -Original Message- > From: Antony Paul [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 17, 2003

RE: How to detect duplicate messages in log4j

2003-12-17 Thread Ken . Liu
There isn't an API where you can access a set of previous messages. However, Ceki describes a good approach in his book. You can create a Filter that hangs on to the previous LogEvent and suppresses an incoming LogEvent if it is a duplicate. There is nothing to prevent you from buffering n numbe

RE: setting up multiple log4j configurations for multiple WAR pac kage s?

2003-11-24 Thread Ken . Liu
Hey now, I didn't mean to imply that there is no other way to do it, but it seemed to me that Erik was going down the "log4j only in the WARs" path, so I was trying to help him out with that. Anyways, I did look into the servlet spec (2.3 and 2.4), and indeed it mentions in SRV7: "It is recommend

RE: setting up multiple log4j configurations for multiple WAR pac kage s?

2003-11-21 Thread Ken . Liu
IMHO, the simplest and easiest configuration to maintain is to place log4j.jar in WEB-INF/lib and log4j.xml in WEB-INF/classes in each WAR. This should work fine without any additional server configuration. You should not have log4j.jar in your server's classpath or logging won't be separate betw

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 conte

RE: Revamp: App-server independent log4j logging

2003-11-17 Thread Ken . Liu
No. log4j looks for log4j.properties and log4j.xml in the same places, it just looks for log4j.xml first. Ken > -Original Message- > From: Wendy Smoak [mailto:[EMAIL PROTECTED] > Sent: Monday, November 17, 2003 11:10 AM > To: Log4J Users List > Subject: RE: Revamp: App-server independent

RE: Revamp: App-server independent log4j logging

2003-11-17 Thread Ken . Liu
Tom, you're not stupid. If the one and only log4j.jar is in WEB-INF/lib, then putting log4j.properties in WEB-INF/classes should work. WEB-INF/classes should automatically be part of the webapp's classpath, so log4j should find it. Are you deploying as an EAR? Is WEB-INF/classes in the system c

RE: I cannot figure out where my extra message line comes from on the console

2003-11-12 Thread Ken . Liu
Paul - Are you sure about that? I thought that only happened with BasicConfigurator.configure() (no params). /** Add appender to the root category. @param appender The appender to add to the root category. */ static public void configure(Appender appender) { Logger root =

RE: automatic reload

2003-11-11 Thread Ken . Liu
BTW, reloading via a servlet in this way has some potential security implications, so tread carefully. Ken > -Original Message- > From: Liu, Ken (C) > Sent: Tuesday, November 11, 2003 3:41 PM > To: [EMAIL PROTECTED] > Subject: RE: automatic reload > > > > I don't know, perhaps

RE: automatic reload

2003-11-11 Thread Ken . Liu
> I don't know, perhaps my solution is too simplistic or too > low-tech, but for a webapp, I simply have a URL that I ping > when I change > the log4j config file. Since the config file doesn't change > automatically, This is the approach I use. I have a servlet that calls configur

RE: automatic reload

2003-11-11 Thread Ken . Liu
I don't think addShutdownHook() is enough for a J2EE deployment if you are relying on static initialization of the thread. Static initialization occurs upon application deployment, but the shutdown hook would only run when the server is stopped, not when the application is undeployed. Consequently

RE: Problem with logging separation between webapps and container

2003-11-06 Thread Ken . Liu
Hi Stephanie - I don't think we can fully answer your question unless you share with us how you have implemented the custom repository selector. In my environment, there is a globally shared security-related jar that is in the server's classpath (ugh, not my choice) which uses log4j. We had used

RE: Converting Log4j code to java.util.logging

2003-10-21 Thread Ken . Liu
It's best not to get offended by Hani - if you go back and read the archives, you'll find that every entry has the same kind of attitude, so it's really a bit of a joke. It is called "The Bileblog", after all. -Original Message- From: Tom Eugelink [mailto:[EMAIL PROTECTED] Sent: Tuesday,

RE: Making HTML log file available through web app

2003-10-17 Thread Ken . Liu
Yeah, Dennis, you're right. Sorry, I hadn't quite thought it through (long day yesterday). You probably would have to run exploded if you wanted to write the html file under your webapp, although I wouldn't recommend forcing anyone to deploy exploded. Perhaps you could write to your web server's

RE: Making HTML log file available through web app

2003-10-16 Thread Ken . Liu
This isn't necessarily app-server independent, but you can probably can take advantage of variable substitution in the config file. Log4j can substitute system property values into the log4j config file using the Ant-like syntax (${}), so if your app server puts deployment-specific information int

RE: Enhancement Request

2003-10-15 Thread Ken . Liu
You can easily implement this yourself by creating a custom Filter that holds onto the last logging event and compares it with the current log event. The filter can then suppress the message if the text is the same. Ken -Original Message- From: Steve Widom [mailto:[EMAIL PROTECTED] Sent:

RE: Logging from an applet - loading configuration problem

2003-10-15 Thread Ken . Liu
Daniel - The log4j config file is loaded in a static initializer, so initialization will occur in the first instance of a class that calls LogManager (indirectly). This usually happens when you create an instance of a Logger, which most people do in a static initializer (i.e. "static final LOGGER

RE: include parameters, properties file in xml?

2003-10-09 Thread Ken . Liu
The properties file supports variable substitution in parameter values using the same syntax as Ant (${}). The property values will be read from the system properties, which you can define on the command line at runtime or set programmatically. In log4j.properties, you can also define arbitrary p