Reputation: 1747
I'm writing logs to a text file using Log4Net.dll v1.2.10. Here is how I'm logging the information:
Private loger As ILog = LogManager.GetLogger("MyAppName")
loger.Debug("some message")
Here is what I see in log text file:
2018-10-25 13:46:15,970 [6] DEBUG - [MyAppName] some message
My question: Is it possible to only log "some message" text in file without timestamp and other extra information?
Any kind of solution or workaround would be highly appreciated.
Upvotes: 2
Views: 423
Reputation: 17018
That is very easy. Configure your file appender to use this layout pattern:
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message%newline" />
</layout>
Upvotes: 4