[ 
https://issues.apache.org/jira/browse/LOG4J2-2251?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Cristian Manuel Vertiz Fernandez updated LOG4J2-2251:
-----------------------------------------------------
    Description: 
In PatternLayout log not worling for %M (%method) and %L (%line)

 

Example log4j2.properties

 
{noformat}
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd' 'HH:mm:ss,SSSZ} %-5p [%t] 
%c{10}:%M:%L - %m%n 
logger.console.name = my.package
logger.console.level = info
logger.console.additivity = false
logger.console.appenderRef.rolling.ref = STDOUT

rootLogger.level = info
rootLogger.appenderRef.stdout.ref = STDOUT
{noformat}
 

Current output is:
{noformat}
2018-02-14 15:57:00,001-0400 INFO  [myThread] my.package.MyClass:: - some log 
message{noformat}
 

Expected outoput is:
{noformat}
2018-02-14 15:57:00,001-0400 INFO  [myThread] my.package.MyClass:myMethod:10 - 
some log message{noformat}
 

  was:
In PatternLayout log not worling for %M (%method) and %L (%line)

 

Example log4j2.properties

 
{noformat}
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd' 'HH:mm:ss,SSSZ} %-5p [%t] 
%c{10}:%M:%L - %m%n 
logger.console.name = my.package
logger.console.level = info
logger.console.additivity = false
logger.console.appenderRef.rolling.ref = STDOUT

rootLogger.level = info
rootLogger.appenderRef.stdout.ref = STDOUT
{noformat}
 

Output is:
{noformat}
2018-02-14 15:57:00,001-0400 INFO  [myThread] my.package.MyClass:: - some log 
message{noformat}
 


> PatternLayout not worling properly
> ----------------------------------
>
>                 Key: LOG4J2-2251
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2251
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.10.0
>            Reporter: Cristian Manuel Vertiz Fernandez
>            Priority: Major
>
> In PatternLayout log not worling for %M (%method) and %L (%line)
>  
> Example log4j2.properties
>  
> {noformat}
> appender.console.type = Console
> appender.console.name = STDOUT
> appender.console.layout.type = PatternLayout
> appender.console.layout.pattern = %d{yyyy-MM-dd' 'HH:mm:ss,SSSZ} %-5p [%t] 
> %c{10}:%M:%L - %m%n 
> logger.console.name = my.package
> logger.console.level = info
> logger.console.additivity = false
> logger.console.appenderRef.rolling.ref = STDOUT
> rootLogger.level = info
> rootLogger.appenderRef.stdout.ref = STDOUT
> {noformat}
>  
> Current output is:
> {noformat}
> 2018-02-14 15:57:00,001-0400 INFO  [myThread] my.package.MyClass:: - some log 
> message{noformat}
>  
> Expected outoput is:
> {noformat}
> 2018-02-14 15:57:00,001-0400 INFO  [myThread] my.package.MyClass:myMethod:10 
> - some log message{noformat}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to