[logback-dev] MessageFormatter
Joern Huxhorn
jhuxhorn at googlemail.com
Mon Jan 18 14:25:46 CET 2010
On 18.01.2010, at 13:39, Ruediger zu Dohna wrote:
> Hi!
>
> Logback has two levels of formatting: One for the complete log entry
> and one for the log message itself. While it's flexible with the
> first, it's restrictive with the second, as the MessageFormatter
> class is right now a static-methods-only singleton. By making it an
> interface with a default implementation, one could reconfigure a
> Layout to use a different Formatter with other features.
>
> We'd like to have a message formatter that:
> 1. Appends all arguments that don't have a formatting anchor ("{}").
> 2. Configurably allow special formatting of arguments of some class.
>
> The workaround we are living with now is to use mainly a copy of the
> current MessageFormatter class.
>
> Before I file an JIRA entry and maybe even provide a patch, I'd like
> to know what others think.
>
My proposal for a refined slf4j API over at http://bugzilla.slf4j.org/show_bug.cgi?id=31#c69
has the ability to use custom-made Message implementations.
Changing the default message format (or making it configurable) of
Logback, on the other hand, isn't a good idea since the contract of it
is derived from SLF4J. Any SLF4J implementation must be able to
support the new formatting.
I'd be happy if you could take a few minutes and check out my proposal.
Thanks,
Joern.
>
> Regards
> Rü
> _______________________________________________
> logback-dev mailing list
> logback-dev at qos.ch
> http://qos.ch/mailman/listinfo/logback-dev
More information about the logback-dev
mailing list