logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pelton, Brian" <bpel...@jgboswell.com>
Subject RE: Use properties in log file name
Date Thu, 27 Apr 2006 20:10:34 GMT
I guess I didn't look hard enough.  I found out how to do it:

<file type="log4net.Util.PatternString"
value="logs/RecBuilder.%property{log4net:HostName}.log" /> 

-----Original Message-----
From: Pelton, Brian [mailto:bpelton@jgboswell.com] 
Sent: Thursday, April 27, 2006 12:51 PM
To: log4net-user@logging.apache.org
Subject: Use properties in log file name

I would like to use the host name in the log file's name:
  <appender name="LogAppender" type="log4net.Appender.FileAppender,
    <file value="logs/RecBuilder.[%p{log4net:HostName}].log" />

But this doesn't work.
When I look at log4net's internal log, it says it cannot create the
appender because:
"System.NotSupportedException: The given path's format is not

Is there anyway to have a dynamic log file name based on the machine
name or other environment variables?


View raw message