I’m wondering if there’s a typical log4j typical ConversionPattern layout that can be used with log4j. The objective is to set up a usable log4j quickly.
I’ve choose this parameters ; is there some others which can be useful ?
Console appender
%d %p [%t] %c{2} (%F:%L) %x - %m%n
Date Priority [OutputName] Category (File:Line) DiagnosticContext - SuppliedMessage/n
File Appender
%d %p %c{2} - %m%n
Date Priority Category - SuppliedMessage/n
Here’s the log4j Pattern parameters
https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html
The pattern layout exists to be flexible, to let everyone tune it to match his/her needs, so whatever you feel appropriate for you would do well, with one note: make sure you understand performance implications of what you come up with (note all “WARNING: Generating caller location information …” on https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html). This is my typical usage.