Hi Ionel,
by System.setErr(PrintStream) and System.setOut(PrintStream) .
If you want to integrate that in log4j, I suggest that you either directly use these
commands in your application or extend a FileAppender so that during initialization
this methods are called with the files you want to wr
Sorry,
I don't have the StackTrace any longer. There is only one thing I remember:
It did not come up with a difference (change) in an interface or super class (like
"method has previously been static" or "MethodNotFound") It simply stated that there
was a compatbility issue). I can't remember t
We had a similiar problem, when someone unintentionally deployed a newer version of
log4j (1.2.8, but we are still on 1.2.5) as a jar file in the lib directory of a
webapplication. Depending on which application was called first (and thus initialized
our environment) sometimes the newer log4j c
Wouldn't it be possible to use Logger.log(Priority,Object) instead of e.g.
Logger.debug(Object)? In this case you could set Priority depending on user and
process/program/class and pass it along with the message object to log4j.
You would than have only one logger per application (thus saving mem
Hi Marco,
sorry, i did not read Yoav's reply before I submitted mine. for some unexplainable
reason Yoav's mail reached my mailbox only after I sent my reply.
Since I never use getAllAppenders() before, i looked into the java doc files.
According to that getAllAppenders() returns all appender fo
Hi Marco,
To make sure, you get all available loggers , I would use
for( Enumeration enumLoggers =
LogManager.getCurrentLoggers();enumLoggers.hasMoreElements();) {
Logger logCurrent = (Logger) enumLoggers.nextElement() ;
for (Enumeration enumAppenders =
logCurrent.getAllAppender
Normally I would have answered to Stephen only. But this is a question you often find
and so it might be of interest to more users.
(1) for java 1.3 or less you might use
public static String getClassName() {
CurrentClassGetter ccg = new CurrentClassGetter() ;
That's weird. Are you sure, that the NPE is thrown in that line of code and not within
the get() method itself ? The later would be explained by what I found on
www.dejanews.com .
I searched for InheritableThreadLocal (the parent class of ThreadLocalMap) and
NullPointerException in dejanews