Log4Net: How to specify different level to separate appenders for ASP.NET -
For Log4Net used in ASP.NET, I see the Web. How can I specify different levels to separate the attendants in the config?
Thank you.
Here's a pure idea to play.
Documentation & amp; Thought, this could be the way to do this.
Note: debug
level message console & amp; Level messages are logged in the Warning
event.
I hope this works :)
& lt; Log4net & gt; & Lt ;! - A1 is a console adapter set - & gt; & Lt; Appender Name = "A1" type = "log4net.Appender.ConsoleAppender" & gt; & Lt ;! - A1 uses PatternLayout - & gt; & Lt; Layout type = "log4net.Layout.PatternLayout" & gt; & Lt; Conversion value = "% - 4timestamp [% thread]% -5 level% logger% ndc -% message% newline" /> & Lt; / Layout & gt; & Lt; / Appender & gt; & Lt; Appender name = "Event logic" type = "log4net.Appender.EventLogAppender" & gt; & Lt; Layout type = "log4net.Layout.PatternLayout" & gt; & Lt; Conversion pattern value = "% date [% thread]% -5 level% logger [% properties {NDC}} -% message% newline" /> & Lt; / Layout & gt; & Lt; / Appender & gt; & Lt; Logger name = "debug logger" & gt; & Lt; Level value = "DEBUG" /> & Lt; Epander-reef ref = "A1" /> & Lt; / Logger & gt; & Lt; Logger name = "warnogger" & gt; & Lt; Level value = "WARN" /> & Lt; Appender-Reef Ref = "Event Logifier" /> & Lt; / Logger & gt; & Lt; / Log4net & gt;
Comments
Post a Comment