What is the correct syntax for the datePattern to keep the .log extension on
the rolled over files, such as 
Mylog.log
Mylog.2008-02.log
Mylog.2008-03.log
Mylog.2008-04.log
 
I don't want the date of the file to be the last extension. I have tried the
following but get an error:
System.NotSupportedException: The given path's format is not supported.
   at System.Security.Util.StringExpressionSet.CanonicalizePath(String path,
Boolean needFullPath)
   at System.Security.Util.StringExpressionSet.AddExpressions(String[] str,
Boolean checkForDuplicates, Boolean needFullPath)
   at System.Security.Permissions.FileIOAccess.AddExpressions(String[]
value, Boolean checkForDuplicates, Boolean needFullPath)  ...etc 
The append works fine withouth the DatePattern, but I always get the above
error using any datePattern statement like:
<param name="DatePattern" value=".yyyy.MM" />
 
<appender name="StatisticsRollingFileAppender" 
type="log4net.Appender.RollingFileAppender" >
<param name="File" value="Log/Statistics.log" />
<param name="DatePattern" value=".yyyy.MM.dd hh:mm.log" />
<param name="AppendToFile" value="true" />
<param name="MaximumFileSize" value="300KB" />
<param name="MaxSizeRollBackups" value="5" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern"  value="%m%n" />
</layout>
</appender>
 
I also tried with tick marks:
<param name="DatePatern" value=".yyyy.MM.dd hh:mm.'log'" />

Thanks,

Joe.

 

Reply via email to