logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: Logging messages using java 1.5 format string
Date Mon, 04 Aug 2008 21:39:23 GMT
Thorbjørn Ravn Andersen wrote:
> Ashish Kulkarni skrev  den 04-08-2008 21:45:
>> Hi
>> Is there anyway to format the log messages using java 1.5 format
>> capabilities
>> for example i can have a nice formatted out put using
>> System.out.format("Number of Users on Registry %1$s, is %2$d",
>> registry.getName(), userSet.size());
>>   
> Use slf4j as the logging interface and use log4j as the backend.
> 
> You can then call
> 
> log.debug("Name: {} Size {}", "Foo", new Integer(10));
> 
> 

No need for SLF4J.  Use the Log4j "extras" companion [1] LogMF [2] or LogSF [3]
utility classes.

[1] http://logging.apache.org/log4j/companions/extras/download.html
[2]
http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/LogMF.html
[3]
http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/LogSF.html

Jake

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


Mime
View raw message