logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leon Finker"<leon...@gmail.com>
Subject OnStartupTriggeringPolicy/custom header
Date Wed, 15 Jun 2016 15:17:58 GMT
Hi,

What would be the best way to implement the following:
1. Always roll log file once on JVM startup (and only on JVM startup).  - This could be done
with implementing another OnStartupTriggeringPolicy (the one from 2.6.1+ doesn't roll empty
files anymore).
2. Log an entry in the new log file (after the roll) with something like:
Constants.LINE_SEPARATOR + "---------- " + DateTime.now() + " STARTING " + service_instance_Name
+ " " + getProcessId() + " ----------"
- Does PatternLayout's header support system property lookup variables (i.e.: service instance
name and date time now)?
- Not sure how to allow for custom method call to get the getProcessId() into the header
- It could've been easy if I could do it from OnStartupTriggeringPolicy, but there is no way
to write to the new rolled log file from there.

Is there a way?

Thank you

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


Mime
View raw message