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

Ralph Goers commented on LOG4J2-1832:
-------------------------------------

You appear to be adding to an existing configuration. The appender you are 
adding is named "log-file-appender". Your AppenderRef references an appender 
named "File", which may or may not exist. The LoggerConfig you have created has 
additivity=true so it will write to the root logger in addition to the logger 
you configured. 

The final process will be to try to write to Logger "logger", which will have 
an AppenderRef of "File" that might not exist. It will then log to the root 
logger and do whatever that says.


> Programmatical Configuration of Log4j2 with RollingFileAppender does not 
> honor logging classnames
> -------------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-1832
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1832
>             Project: Log4j 2
>          Issue Type: Question
>          Components: Configurators
>    Affects Versions: 2.7
>         Environment: Ubuntu 16.04
>            Reporter: vaibhav singh
>              Labels: beginner, features
>             Fix For: boot-1.0-alpha1
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I am trying to programmatically configure a Log4j2 logger with a Rolling File 
> appender, and am seeing that classnames are not getting printed according to 
> the Layouts page(https://logging.apache.org/log4j/2.x/manual/layouts.html)
> Can someone please help me understand why is it that the classname is not 
> getting printed? Is it an existing bug with PatternLayout class?
> Test class:
> http://pastebin.com/yBQ7mGPC
> Output:
> http://pastebin.com/cnfnqauz



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to