Re: LogManager.resetConfiguration in log4j2

2017-03-14 Thread Ralph Goers
Actually, the equivalent would be set the configuration back to the DefaultConfiguratoin, not a null configuration. Ralph > On Mar 14, 2017, at 9:09 PM, Matt Sicker wrote: > > After looking at the source code for Hierarchy::resetConfiguration(), I see > that there's no

Re: LogManager.resetConfiguration in log4j2

2017-03-14 Thread Matt Sicker
After looking at the source code for Hierarchy::resetConfiguration(), I see that there's no specific analog in 2.x. However, the following snippet should do about the same thing: LoggerContext ctx = LoggerContext.getContext(false); ctx.setConfiguration(new NullConfiguration()); On 14 March 2017

Re: LogManager.resetConfiguration in log4j2

2017-03-14 Thread Matt Sicker
I'm not exactly sure what that's supposed to do, but if you cast the LoggerContext from LogManager.getContext() to the implementation class in log4j-core, there's a reconfigure() method. https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/LoggerContext.html On

LogManager.resetConfiguration in log4j2

2017-03-14 Thread kriegerd
Hi, Is there a way to emulate the behavior of LogManager.resetConfiguration in log4j2? We need to migrate the functionality of an older class that uses it. Thanks! Alejandro.

Re: Is it possible to add a new Logger at runtime via JMX?

2017-03-14 Thread Matt Sicker
The JMX GUI provides a way to edit your configuration file which is the standard way to change those settings. Without using the GUI, this is all done from the LoggerContextAdminMBean if you need to do it remotely. Otherwise, there are other

Re: log4j2 issue

2017-03-14 Thread Matt Sicker
The gist of what you're probably looking for is a failover appender configuration: < https://logging.apache.org/log4j/2.x/manual/appenders.html#FailoverAppender>. This can be used to switch to another appender when one fails which is perfect for networked appenders. On 14 March 2017 at 07:00,

Is it possible to add a new Logger at runtime via JMX?

2017-03-14 Thread Marasoiu Nicolae
Hi, I wonder if it is possible to add Loggers or Appenders at runtime, or change / interpose nodes in the tree of loggers, or the tree of appenders, in a structural way at runtime, via JMX or other means. A practical example is a component which is too verbose, and it is component (a

log4j2 issue

2017-03-14 Thread Yang Rui
Hi, I am Rui from China. We use both of KafkaAppender (with a AsyncAppender wrapper) and FileAppender of log4j2 with version 2.6.2 in the application. Here is the scenaria, when kafka cluster down and stop service, the application will slow down and wait for given timeout (request.timeout.ms)