Can you set a breakpoint on Logger.Debug(...) and check if Logger.IsDebugEnabled returns true?
How does your EPiServerLog.config file look like?
<?xml version="1.0" encoding="utf-8"?> <log4net> <appender name="errorFileLogAppender" type="log4net.Appender.RollingFileAppender" > <!-- Consider moving the log files to a location outside the web application --> <file value="App_Data\EPiServerErrors.log" /> <encoding value="utf-8" /> <staticLogFileName value="true"/> <datePattern value=".yyyyMMdd.'log'" /> <rollingStyle value="Date" /> <threshold value="Error" /> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> <appendToFile value="true" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date [%thread] %level %logger: %message%n" /> </layout> </appender> <appender name="outputDebugStringAppender" type="log4net.Appender.OutputDebugStringAppender" > <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="[%thread] %level %logger: %message%n" /> </layout> </appender> <!-- Reduce amount of debug logging --> <logger name="EPiServer.Core.OptimisticCache" additivity="false"> <level value="Error" /> </logger> <logger name="EPiServer.Core.ContentProvider" additivity="false"> <level value="Error" /> </logger> <logger name="EPiServer.Data.Dynamic.Providers.DbDataStoreProvider" additivity="false"> <level value="Error" /> </logger> <logger name="EPiServer.Data.Providers.SqlDatabaseHandler" additivity="false"> <level value="Error" /> </logger> <logger name="EPiServer.Data.Providers.ConnectionContext" additivity="false"> <level value="Error" /> </logger> <logger name="EPiServer.Framework.Initialization"> <level value="All" /> </logger> <root> <!--Be careful, setting this value to All, Debug or Info will affect performance.--> <level value="Error" /> <!--Enabled file logging--> <appender-ref ref="errorFileLogAppender" /> <!-- Use DebugView (Microsoft/SysInternals) and enable Capture Win32 + Capture Global Win32 (http://technet.microsoft.com/en-us/sysinternals/bb896647). --> <!--appender-ref ref="outputDebugStringAppender" /--> </root> </log4net>
That is my episerver.log and Logger.IsDebugEnabled() return false ... what am i missing?
On line 10, you have threshold value="Error" which means that Info, and Debug messages won't be logged.
Is that a comma seperated field... If i want the debug messages to be logged as well do i write threshold value="Error,Debug" ?
No, single value.
I hope this blog post will help you: http://dcaric.com/blog/episerver-logging-and-troubleshooting-log4net
thanks good info...
there you say that "If we open EPiServerLog.config file, we'll see that threshold value is set to Error. This means that only Error (and higher level) messages will be logged."
What is the level structure. So if i add Debug, will Error also be logged?
What is the correct level sequence. Because if i add Debug, i want Error also to be logged..
If set DEBUG or ALL, everything will be logged.
If you set ERROR, only ERROR and FATAL will be logged.
Hey Guys,
i'm using this:
But it is not written in the EPiServer log located in the app_data folder...
Is this not the correct way to do this?