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 Derek Moore <de...@perceptivesoftware.com> on 2012/08/21 00:51:09 UTC

[log4j2] XML concise mode, class names to XML tags

I'm incorporating log4j 2.0-alpha1 into an existing product to
replace/improve a logging infrastructure based on java.util.logging.

log4j2 looks rather nice, I like how it adds further refinement to slf4j's
improvements.

The configuration documentation is nice, but obviously it's all over the
map (as are most things similarly open-ended, so that's understandable).

Coming away from my first few days messing with it, I am curious how XML
tags relate to class names.

<RollingFile> translates to RollingFileAppender
but
<PatternLayout> or <CompositeTriggeringPolicy> translate to PatternLayout &
CompositeTriggeringPolicy

It might be a good idea to just be consistent with the Concise XML format.
As is, it kind of leaves you guessing as to when tag names will & will not
be concatenated to resolve class names.

Hopefully I'll have more productive things to say as I work with log4j2 in
completing this project, but you gotta start somewhere.

Thanks!

Derek Moore

Re: [log4j2] XML concise mode, class names to XML tags

Posted by Ralph Goers <ra...@dslextreme.com>.
Thanks, Derek. All feedback is welcome.

When I first started naming things I had the "type" tacked on to the end. But then I noticed that the appenders all had to appear within an appenders element so adding "Appender" to the end of them all seemed pointless as they all obviously had to be Appenders.  However, the same isn't true with Filters and Layouts, etc., which can appear in any order and you wouldn't necessarily know what they were without adding its type to its name. 

Ralph

On Aug 20, 2012, at 3:51 PM, Derek Moore wrote:

> I'm incorporating log4j 2.0-alpha1 into an existing product to replace/improve a logging infrastructure based on java.util.logging.
>  
> log4j2 looks rather nice, I like how it adds further refinement to slf4j's improvements.
>  
> The configuration documentation is nice, but obviously it's all over the map (as are most things similarly open-ended, so that's understandable).
>  
> Coming away from my first few days messing with it, I am curious how XML tags relate to class names.
>  
> <RollingFile> translates to RollingFileAppender
> but
> <PatternLayout> or <CompositeTriggeringPolicy> translate to PatternLayout & CompositeTriggeringPolicy
>  
> It might be a good idea to just be consistent with the Concise XML format. As is, it kind of leaves you guessing as to when tag names will & will not be concatenated to resolve class names.
>  
> Hopefully I'll have more productive things to say as I work with log4j2 in completing this project, but you gotta start somewhere.
> 
> Thanks!
>  
> Derek Moore


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