[
https://issues.apache.org/jira/browse/LOG4J2-468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13851881#comment-13851881
]
Ralph Goers commented on LOG4J2-468:
------------------------------------
You would do something like:
{code}
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
Configuration config = ctx.getConfiguration();
config.addLogger("com.mycorp.myproduct.mypackage", Level.INFO, (Filter) null);
{code}
Note that anything added programmatically will be lost if a reconfiguration
occurs. In that case you are better off extending XMLConfiguration to add your
own customizations.
> Dynamically (programmatically) add logger in Log4j2
> ---------------------------------------------------
>
> Key: LOG4J2-468
> URL: https://issues.apache.org/jira/browse/LOG4J2-468
> Project: Log4j 2
> Issue Type: New Feature
> Reporter: Dean Anderson
>
> Please add the ability for someone to dynamically add a new Logger
> programmatically.
> Thank you.
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]