Oh, good catch, never used the API like that outside of unit tests.
On 9 November 2015 at 23:21, Ralph Goers wrote:
> Matt, the advice below won’t work properly. The LoggerConfig must be
> modified, not the Logger. Then updateLoggers must be called (which will
> update the logger’s level).
>
> R
Matt, the advice below won’t work properly. The LoggerConfig must be modified,
not the Logger. Then updateLoggers must be called (which will update the
logger’s level).
Ralph
> On Nov 9, 2015, at 9:07 PM, Matt Sicker wrote:
>
> You can find the Logger from LogManager, cast to
> org.apache.log
We have unit tests that do this. Basically you need to do:
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
final Configuration config = ctx.getConfiguration();
Map loggers = config.getLoggers();
for (Map.Entry logger : loggers.entrySet()) {
logger.setLevel(Level.DEBUG)
And by JMX, I meant the MBean class (not jConsole):
http://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/jmx/LoggerConfigAdminMBean.html
On 9 November 2015 at 22:07, Matt Sicker wrote:
> You can find the Logger from LogManager, cast to
> org.apache.logging.log4j.c
You can find the Logger from LogManager, cast to
org.apache.logging.log4j.core.Logger, and use setLevel, though I bet
there's a better way to do this via configuration files. You can reload the
configuration file and modify that from the user, but that might be
overkill here.
On 9 November 2015 at
Looking at https://logging.apache.org/log4j/2.0/manual/jmx.html
Doesn't seem like the solution.
Asking the user to bring up jconsole seems rather excessive.
I just want to provide 3 radio buttons in my configuration. Logging Normal,
Medium, Full.
-Original Message-
From: Matt Sicker [mai
Loggers can be reconfigured through JMX.
On 9 November 2015 at 19:53, John Lussmyer wrote:
> I'm hoping there is an easy to to just change the root level of my logger
> configuration on the fly.
> I want to be able to provide a configuration option to my users to turn up
> the logging level.
> I
I'm hoping there is an easy to to just change the root level of my logger
configuration on the fly.
I want to be able to provide a configuration option to my users to turn up the
logging level.
I don't want to reconfigure everything, just change the level.
Is there any easy way to do that? Or d
Ben,
Is there a way the current HTML layout could be customized to be better
suited to your use-case?
Gary
On Mon, Nov 9, 2015 at 11:09 AM, Benjamin Jaton
wrote:
> Thanks the feedback.
> I found that the easiest way to achieve this was to have the PatternLayout
> class support to set the conte
Thanks the feedback.
I found that the easiest way to achieve this was to have the PatternLayout
class support to set the contentType to "text/html".
Then one can write HTML directly in the pattern.
Thanks again,
Ben
On Mon, Nov 9, 2015 at 6:51 AM, Remko Popma wrote:
> Ben,
>
> The built-in HTML
Ben,
The built-in HTML layout
(https://logging.apache.org/log4j/2.x/log4j-core/xref/org/apache/logging/log4j/core/layout/HtmlLayout.html)
does not support much customization.
It sounds like you may want to create a custom layout and specify that layout
with the SMTP appender.
This manual p
11 matches
Mail list logo