hi, i am trying to configure a dynamic name for my log but i can't.
here the code on my web.config file:
<appender name="RollingFile" type="log4net.Appender.RollingPatternFileAppender">
<file type="log4net.Util.PatternString" value="..l\log\%property{LogName}" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="-1" />
<maximumFileSize value="5000KB" />
<staticLogFileName value="true" />
<countDirection value="1"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%m%n" />
</layout>
<filter type="log4net.Filter.PropertyFilter">
<Key value="Version" />
<StringToMatch value="1" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<root>
<level value="DEBUG"/>
<appender-ref ref="RollingFile"/>
</root>
here the global.asax
log4net.Config.XmlConfigurator.Configure();
and here the codebehind:
log=LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
log4net.ThreadContext.Properties["LogName"] = sito + "_Truck_Log_" + DateTime.Today.ToString("dd-MM-yyyy") + ".txt";
it does not creates any file. what is wrong in this configuration?
Thx in advance!