Possible Duplicate:
log4net file names based on GlobalContext properties
This is really starting to bother me. I'm just simply trying to add a property variable to a log4Net filename. What am I doing wrong?
Here's the config:
<appender name="logger1" type="log4net.Appender.FileAppender">
<file type="log4net.Util.PatternString" value="C:\temp\file_%property{foo}.log" />
<appendToFile value="true" />
<Layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%newline%date --- %message%newline" />
</Layout>
</appender>
And here's the code:
string foo= "bar";
log4net.GlobalContext.Properties["foo"] = foo;
_logger.ErrorFormat("test");
And the resulting log name is file-(null).log
Anyone see anything that I'm missing here? Because otherwise it seems to me to be a bug.