log4cxx's config is read from follow-by xml via:
DOMConfigurator::configure("log4cxx.xml");
But, want to have filename set at runtime, and this creates a problem of either having multiple .xmls for reading, or creating one on the fly (in memory/at disk -- no matter where).
<appender name="appxNormalAppender" class="org.apache.log4j.FileAppender">
<param name="file" value="appxLogFile.log" />
<param name="append" value="true" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%t:%x] %C{2} (%F:%L) - %m%n" />
</layout>
</appender>
Is there any way to pass configurator some values to substitute into <param file="file" value="%%value%%" />
or to access the property after configuring and change it?
P.S. The reason for doing this: multiple copies of the same program are writing to same log making it look ..strange. How to avoid this with log4j/log4cxx in traditional way without inventing too much bicycles?