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 Andrew Berman <re...@gmail.com> on 2013/07/11 00:44:36 UTC
Custom Layout Configuration Help using Log4j2-beta7
Hello,
I've written a custom layout and a helper class. It all works great,
however, my question has to do with how to interpolate the variables inside
of an attribute in the configuration. For example:
<Socket name="socket" host="foo.com" port="5544" protocol="TCP">
<MyLayout>
<additionalField name="program" value="${sys:mySysProperty}"/>
<additionalField name="environment" value="qa"/>
</MyLayout>
</Socket>
What I'm trying to figure out is how I can get the $[sys:mySysProperty} to
resolve to the proper value. I've looked through the code at
DailyRollingFileAppender to see how it does it, but I can't seem to find
anything actually performing the resolution. Can someone point me in the
right direction?
Thanks,
Andrew