On the log4j user mailing list I encountered a user who had made a few wrong 
turns, config-wise, and had trouble getting back on track.

One issue was that by default the File appender is buffered but does not flush.
So his log file stayed empty and he had trouble figuring out why.

Should we change the examples a little?
* use bufferedIO=false in all File appender examples?

* add a comment that the root logger is mandatory (LOG4J2-219)

Also I would like to propose (and opinions may differ on this one)
to avoid using layouts that use location in the examples,
unless the example is used to explain how location works.
(E.g., the API > Flow Tracing page would need location layout examples.)

Currently most examples use %C and %M and I would greatly prefer that the 
examples use %c and other layouts that do not include location. 

I believe that many people will start using Log4j by copying an example and 
only read the manual when they get stuck.
I would hate to give first-time users the impression that Log4j is slow and 
have our own example configs to blame... :-)


On the same topic, in the layouts page I would like to add remarks describing 
performance impact to the attributes that include location.

Thoughts?

Reply via email to