AW: catching System.out and System.err into log4j

2004-08-25 Thread gyoergy.magoss
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

AW: JDK compatibility

2004-07-23 Thread gyoergy.magoss
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

AW: JDK compatibility

2004-07-23 Thread gyoergy.magoss
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

AW: Need to log based on criteria other than simply levels

2004-03-24 Thread gyoergy.magoss
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

AW: AW: getting an Appender object at runtime

2004-03-09 Thread gyoergy.magoss
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

AW: getting an Appender object at runtime

2004-03-08 Thread gyoergy.magoss
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

AW: Getting the current class name in static code

2004-03-03 Thread gyoergy.magoss
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() ;

AW: AW: NullPointerException from MDC in IBM WSAD 5.1/WebSphere 5.0.2

2004-02-05 Thread gyoergy.magoss
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