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
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
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
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
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
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
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
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 =
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
> 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
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
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
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,
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
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
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:
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
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
18 matches
Mail list logo