Log4J: Dynamically add hostname to filename

O

ordawg

I need to dynamically add the hostname to the filename that is
generated from my file appender.

I am not having any luck doing this and I have tried several variations
of the following:

<appender name="localapp"
class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="../logs/$HOST-Application.log"/>
<param name="File" value="../logs/${env.host}-Application.log"/>
<param name="File" value="../logs/${env.HOST}-Application.log"/>
...

Any help would be greatly appreciated!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top