You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by John Lussmyer <Co...@CasaDelGato.com> on 2019/03/18 16:35:21 UTC
Adding Header line in PatternLayout?
I'd like to add a custom Header line to each log that RollingRandomAccessFile produces.
As a test, I've added as simple "header=xxxx" attribute to the PatternLayout.
It's not being output, and log4j isn't reporting any errors.
I've added this to the RollingRandomAccessFile block:
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%20.20t] %-5level %30.30logger - %msg%n" header="Application: ${sys:metrixAppName}%n"/>
The pattern works, but I'm not seeing the "Application ..." line in the log file.