benim ASP.NET MVC3 projesinde Log4net kullanıyorum, ancak tüm giriş özellikleri gibi IsDebugEnabled
== falseNeden tüm log4net düzeyleri yanlış mı?
Ben:
Benim günlük sınıfta[assembly: XmlConfigurator(Watch = true)]
Ben
var Web.config içindepublic Log4NetLogger()
{
log4net.Config.XmlConfigurator.Configure();
Logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
}
My ilgili yapılandırma şeyler:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false"/>
</sectionGroup>
</configSections>
<log4net debug="false">
<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
<bufferSize value="100" />
<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<connectionString value="{removed}" />
<commandText value="INSERT INTO Logging ([Date],[Thread],[Level],[Logger],[Message],[Exception]) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)" />
<parameter>
<parameterName value="@log_date" />
<dbType value="DateTime" />
<layout type="log4net.Layout.RawTimeStampLayout" />
</parameter>
<parameter>
<parameterName value="@thread" />
<dbType value="String" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%thread" />
</layout>
</parameter>
<parameter>
<parameterName value="@log_level" />
<dbType value="String" />
<size value="50" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%level" />
</layout>
</parameter>
<parameter>
<parameterName value="@logger" />
<dbType value="String" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%logger" />
</layout>
</parameter>
<parameter>
<parameterName value="@message" />
<dbType value="String" />
<size value="4000" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message" />
</layout>
</parameter>
<parameter>
<parameterName value="@exception" />
<dbType value="String" />
<size value="2000" />
<layout type="log4net.Layout.ExceptionLayout" />
</parameter>
</appender>
<!--Possible levels:-->
<!--DEBUG-->
<!--INFO-->
<!--WARN-->
<!--ERROR-->
<!--FATAL-->
<root>
<level value="All" />
<appender-ref ref="AdoNetAppender" />
</root>
</log4net>
</applicationSettings>
</configuration>
Zaten sadece
public Log4NetLogger()
{
Logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
Logger.IsDebugEnabled = true;
}
yapmak isteyen bir noktaya sinirli var Ancak tabii
Logger.IsDebugEnabled
herhangi ayarlayıcıları yok: Bu lanet şeyi ne işe ben almak için ne gerekiyor/
?
Bu sorunu sıraladıysanız lütfen aşağıdaki yanıtlardan birini onaylayabilir misiniz? –