[
https://issues.apache.org/jira/browse/LOG4J2-2379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16549389#comment-16549389
]
Ralph Goers commented on LOG4J2-2379:
-------------------------------------
When you modify the configuration you are specifying you want to set the level
of a logger with a certain name. A loggerConfig for that name does not exist so
one must be created. After all, we don't want to be changing the level of the
root logger - that isn't what you asked it to do.
> Is the LoggerConfig name and parent blank for a new logger?
> -----------------------------------------------------------
>
> Key: LOG4J2-2379
> URL: https://issues.apache.org/jira/browse/LOG4J2-2379
> Project: Log4j 2
> Issue Type: Question
> Components: Core
> Affects Versions: 2.11.0
> Reporter: Ranjit Dsouza
> Priority: Major
>
> This is the code snippet, From the output, notice that loggerConfig name is
> blank and its parent is null. Is this how it is supposed to be?
> String loggerName = "com.myCompany.myClass";
> static Logger logger = LogManager.getLogger(loggerName);
> LoggerConfig loggerConfig =
> LoggerContext.getContext(false).getConfiguration().getLoggerConfig(loggerName);
> System.out.println("new loggerConfig name: " + loggerConfig.getName());
> System.out.println("new loggerConfig parent : " + loggerConfig.getParent());
> Output:
> new loggerConfig name:
> new loggerConfig parent : null
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)