Hello,
I'd like to parametrize my log file names with the start date of the process.
This makes it easier for us to see after the facts in the logs if a server was
restarted etc...
The approach I took was the following:
<Properties>
<Property name="log-path">C:\CAPSICO\_Stand_Alone_Runtime_\logs\</Property>
<Property name="now">%d{yyyy-MM-dd}</Property>
</Properties>
<Appenders>
<RollingFile name="FILES" fileName="${log-path}/capsico.%{now}.log"
filePattern="${log-path}/capsico. %{now}.%i.log.gz">
<PatternLayout>
<pattern>%d{MMdd.HHmmss.SSS}#%-3t %level{length=1} %15.15c{1}|
%m%ex{20}%n</pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="100 MB" />
</Policies>
<DefaultRolloverStrategy max="99999" compressionLevel="9"/>
</RollingFile>
</Appenders>
My thinking is that ${now} would be resolved when the system starts, and then I
could use the value in the file names. But the filenames print '${now}'
directly.
Any help would be much appreciated.
Thank you,
Laurent.