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 "Remko Popma (JIRA)" <ji...@apache.org> on 2013/10/16 12:58:42 UTC

[jira] [Commented] (LOG4J2-429) Class name and file number not filled with Async appender

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

Remko Popma commented on LOG4J2-429:
------------------------------------

Yes, this is normal. With AsyncAppender (and AsyncLogger) you need to set {{includeLocation="true"}}. 
The reason is explained here:
http://logging.apache.org/log4j/2.x/manual/layouts.html#LocationInformation

> Class name and file number not filled with Async appender
> ---------------------------------------------------------
>
>                 Key: LOG4J2-429
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-429
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.0-beta9
>            Reporter: Hemri
>
> Hi everyone,
> I found an annoying issue with async appender, with this configuration:
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration>
> 	<Appenders>
> 		<Console name="CONSOLE" target="SYSTEM_OUT">
> 			<PatternLayout pattern="%d %p %c{1.} [%t] (%F: %L) %m%n" />
> 		</Console>
> 		<Async name="ASYNC">
> 			<AppenderRef ref="CONSOLE" />
> 		</Async>
> 	</Appenders>
> 	<Loggers>
> 		<Root level="debug">
> 			<AppenderRef ref="ASYNC" />
> 		</Root>
> 	</Loggers>
> </Configuration>
> I got this log:
> 2013-10-16 11:43:19,033 WARN Foo [main] (: ) Debug message
> And without async:
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration>
> 	<Appenders>
> 		<Console name="CONSOLE" target="SYSTEM_OUT">
> 			<PatternLayout pattern="%d %p %c{1.} [%t] (%F:%L) %m%n" />
> 		</Console>
> 	</Appenders>
> 	<Loggers>
> 		<Root level="debug">
> 			<AppenderRef ref="CONSOLE" />
> 		</Root>
> 	</Loggers>
> </Configuration>
> I got this log:
> 2013-10-16 11:44:16,599 WARN Toto [main] (Toto.java:12) toto
> Is it normal that class name and line number are not filled with async appender?
> Thanks



--
This message was sent by Atlassian JIRA
(v6.1#6144)

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