Ian Vink
Ian Vink

Reputation: 68750

Log4Net: RollingFile Appender - Appending .TXT

I have the following working config:

<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
  <file value=".\\App_Data\\log.txt" />

I want to have the log file appear like this

log.2012-11-28.txt
log.2012-11-29.txt

And so on. Notice the .txt at the end.

How do I change the file value in the config to do that?

Upvotes: 0

Views: 66

Answers (1)

Arsen Mkrtchyan
Arsen Mkrtchyan

Reputation: 50712

Add this to appender configuration, please make sure that you don't have other rollingStyle added

<rollingStyle value="Date" />
<datePattern value="'log.'yyyy-MM-dd'.txt'" />

Upvotes: 1

Related Questions