The parsing of the log4j2 configuration file

I am not familiar with xml. When I read the document about the log configuration, it writes that "appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] [%node_name]%marker %.-10000m%n "

What's the meaning of {ISO8601}, [%-5p], [%-25c{1.}], [%node_name], %marker , %.-10000m ?

This is a fairly standard log4j properties file. In general I suggest leaving it alone unless you need to do something funny with logging. If you do, I'd start a new thread asking about that.

%d{iso8601} says print the date and time in a standard format.

%-5p says print the pevel, padded to five characters and left aligned.

%-25c{1.} says to print the name of the logger, truncating in it a very particular way if it is wider than 25 characters.

%node_name is an elasticsearch extension that logs the name of the node.

%marker is replaced by the index and shard info.

The last one is the actual log message.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.