Re: Bizarre performance in log4j2

2015-10-20 Thread Strong Su
Hello everyone, I take a deep look at our project and found one of our third dependencies was using log4j2. It is using APIs of log4j2 instead of configuration files but it can recognise and use my log4j2.xml. I wrote a simple example to illustrate how log4j2 be added in the third dependency.

Re: ExceptionInInitializerError with JUL turned on

2015-10-20 Thread Ralph Goers
What version of Java and what version of Log4j? Ralph > On Oct 20, 2015, at 10:57 AM, Mike Calmus wrote: > > I'm trying to add the log4j-jul jar to our configuration. I set the > "java.util.logging.manager" system property as per the documentation in the > server's startup

Re: LoggerContext is reloaded on application shutdown

2015-10-20 Thread Ralph Goers
It happens because something is trying to log something after the LoggerContext has ended. Whatever that is needs to happen before the logging system is shut down. Ralph > On Oct 20, 2015, at 11:16 AM, Benoit Mouquet wrote: > > Exactly, that's why I don't understand

Re: ExceptionInInitializerError with JUL turned on

2015-10-20 Thread Mike Calmus
Version 2.4.1 of Log4j. Java 7 (u85). On Tue, Oct 20, 2015 at 2:43 PM, Ralph Goers wrote: > What version of Java and what version of Log4j? > > Ralph > > > On Oct 20, 2015, at 10:57 AM, Mike Calmus wrote: > > > > I'm trying to add the log4j-jul jar

ExceptionInInitializerError with JUL turned on

2015-10-20 Thread Mike Calmus
I'm trying to add the log4j-jul jar to our configuration. I set the "java.util.logging.manager" system property as per the documentation in the server's startup configuration. When I try to start the server I get an ExceptionInInitialerError with the following: Caused By:

Re: LoggerContext is reloaded on application shutdown

2015-10-20 Thread Benoit Mouquet
Exactly, that's why I don't understand what's happen in my application. Indeed, when I shutdown my webapp, the LoggerContext is stop first but restart just after (and not stop again). The normal behavior should be that the LoggerContext it stop and that's all (not start again during the

Re: LoggerContext is reloaded on application shutdown

2015-10-20 Thread Jochen Wiedmann
This is quite as it should. If the webapp is being shutdown, then all acquired resources (including the logging system) are to be released. You'd end up with a resource leak otherwise. Why do you expect log4j to be an exception? Jochen On Tue, Oct 20, 2015 at 6:41 PM, Benoit Mouquet

LoggerContext is reloaded on application shutdown

2015-10-20 Thread Benoit Mouquet
Hello everyone, I send you a mail because I'm currently try to integrate log4j2 in new project (Java web application, spring, hibernate ...). I have configured my dependency (I use SLF4J with Log4j2 and the module Log4j2-web) and create my log4j2.xml file and all seems to work properly. The only

log4j-jcl causing logging issues

2015-10-20 Thread Mike Calmus
I saw this with older version of Log4j 2 as well, but now I'm using 2.4.1 on Java 7. We are including all the log4j libraries in the Weblogic server startup classpath. Commons-logging 1.2 is included as well. All works fine using JndiRepositorySelector when log4j-jcl is not included. When that

Re: Log4j2 set log level, cascade

2015-10-20 Thread Benjamin Jaton
It doesn't look like this is available in 2.3, was it added recently? Any workaround for 2.3? Thanks Ben On Tue, Oct 20, 2015 at 3:26 PM, Gary Gregory wrote: > Check out the > APIs org.apache.logging.log4j.core.config.Configurator.setAllLevels(String, > Level) and

Re: Log4j2 set log level, cascade

2015-10-20 Thread Gary Gregory
Check out the APIs org.apache.logging.log4j.core.config.Configurator.setAllLevels(String, Level) and setLevel(). Gary On Tue, Oct 20, 2015 at 3:13 PM, Benjamin Jaton wrote: > Hello, > > Here is a simple configuration: > > > > > > > > > > *

Re: Log4j2 set log level, cascade

2015-10-20 Thread Gary Gregory
Ben, I would recommend using the current version 2.4.1. I think I added those for 2.4... You can just get the sources from Git and copy the new methods you need to your code base. Of course, using the current version is better IMO. Gary On Tue, Oct 20, 2015 at 3:55 PM, Benjamin Jaton

Log4j2 set log level, cascade

2015-10-20 Thread Benjamin Jaton
Hello, Here is a simple configuration: ** ** ** I am trying to programmatically set the log level of "com.rli", but I can't find the Loggers until they are used: