All I want to do is append the current date and time to my log file, say:
'export_(Wed_Feb_21_2009_at_1_36_41PM)'
Here is my current config from my app.config
<appender name='RollingFileAppender' type='log4net.Appender.RollingFileAppender'> <file value='c:\export.txt' /> <appendToFile value='true' /> <lockingModel type='log4net.Appender.FileAppender+MinimalLock' /> <rollingStyle value='Size' /> <maxSizeRollBackups value='10' /> <layout type='log4net.Layout.PatternLayout'> <conversionPattern value='%date [%thread] %-5level %logger [%property{NDC}] - %message %stackTrace%newline' /> </layout> </appender>
Is appending the date to my log file possible, or is it one of those things I need to do in code and not config?
Add the following to your config file