logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Benedict <pbened...@apache.org>
Subject Pluggable message formats?
Date Thu, 09 Aug 2012 20:26:22 GMT
Forgive me if this feature already exists, but I was hoping to find if
log4j 2 contained a way to configure the format *provider* of
parametrized messages. This is an important aspect for my own work
because I have some sophisticated formatting in my logs that use
String.format() [1] -- especially for floating point values like
currency.

Rather than:
logger.debug("Logging in user {} with id {}", user.getName(), user.getId());

I would like some more complexity like:
logger.debug("Logging in user {%s} with id {%10s}", user.getName(),
user.getId());

I am eager to hear any opinions on my proposed feature.

[1] http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html#syntax

Paul

---------------------------------------------------------------------
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