You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Matt Sicker (JIRA)" <ji...@apache.org> on 2014/08/12 04:15:14 UTC

[jira] [Commented] (LOG4J2-681) Add ability to change log level for any class/package dynamically via jmx

    [ https://issues.apache.org/jira/browse/LOG4J2-681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14093653#comment-14093653 ] 

Matt Sicker commented on LOG4J2-681:
------------------------------------

It would help if you made this into a diff/patch file based on the latest trunk. Although I'm working on some simple additions to the JMX API related to this.

> Add ability to change log level for any class/package dynamically via jmx
> -------------------------------------------------------------------------
>
>                 Key: LOG4J2-681
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-681
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: JMX
>    Affects Versions: 2.0-rc2
>            Reporter: phil wray
>         Attachments: ExampleJmxLoggerAdmin.java, LoggerLevelAdmin.java, LoggerLevelAdminMBean.java, org.apache.logging.log4j.core.jmx.Server.java_patchfile.txt
>
>
> Very useful to be able to change the log levels for any logger (i.e. class or package) at runtime in a long lived server process.
> Usually an arbitrary class will not have its own logger configured already so need to create one on the fly in order to specify its log level without everything else picking it up.
> Example simple implementation of a util I created for this attached.
> Takes a loggerName and level and either updates level if existing logger, or configures a new logger using parent appenders if new.
> Not sure where it would best live - possibly org.apache.logging.log4j.core.jmx.LoggerContextAdmin 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org