I'm trying to pass through a JVM system variable from the command line to the log4j2 instance being used by any Tika child process. This variable substitution works fine, of course, for the parent process where my log4j2.xml line is like so:
<RollingFile name="RollingAppender" fileName="${sys:logpath}" filePattern="${sys:logpath}.%i" append="false">
And that's fed by my command line:
java -Dlogpath="C:\tmp\logstore\foo.log" -jar tika-server.jar -c C:\tmp\configs\tika-config.xml
So in my tika-config.xml I tried the following thing for the child processes which doesn't work:
<forkedJvmArgs>
<arg>-Xms1g</arg>
<arg>-Xmx1g</arg>
<arg>-Dlogpath="${sys:logpath}"</arg>
<arg>-Dlog4j.configurationFile="C:\tmp\configs\log4jTika.xml"</arg>
</forkedJvmArgs>
<arg>-Xms1g</arg>
<arg>-Xmx1g</arg>
<arg>-Dlogpath="${sys:logpath}"</arg>
<arg>-Dlog4j.configurationFile="C:\tmp\configs\log4jTika.xml"</arg>
</forkedJvmArgs>
I do see that if I set the above logpath arg to a literal value, that works but it's not what I'm going for.
Can anyone think of a workaround for this?
-Josh Burchard : HCL
