logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (LOG4J2-631) Update docs to clarify how to use formatter logger and standard logger together
Date Fri, 11 Jul 2014 17:50:05 GMT

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

Remko Popma resolved LOG4J2-631.
--------------------------------

    Resolution: Fixed

Fixed in revision 1609755.
Please verify and close.

> Update docs to clarify how to use formatter logger and standard logger together
> -------------------------------------------------------------------------------
>
>                 Key: LOG4J2-631
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-631
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0-rc1
>            Reporter: Alexandre Gattiker
>            Assignee: Remko Popma
>             Fix For: 2.0
>
>
> {code}
> public class Example {
> 	private final static Logger FORMATTER_LOGGER = LogManager.getFormatterLogger(Example.class);
> 	private final static Logger LOGGER = LogManager.getLogger(Example.class);
> 	public static void main(String[] args) {
> 		LOGGER.log(ERROR, "{} happened", "Something");
> 		FORMATTER_LOGGER.log(ERROR, "%s happened", "Something");
> 	}
> }
> {code}
> {noformat}
> 13:40:35.401 [main] ERROR com.example.Example - {} happened
> 13:40:35.404 [main] ERROR com.example.Example - Something happened
> {noformat}
> After inverting the two constant declarations:
> {noformat}
> 13:41:13.730 [main] ERROR com.example.Example - Something happened
> 13:41:13.732 [main] ERROR com.example.Example - %s happened
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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


Mime
View raw message