我尝试使用elmah log4net appender从log4net登录到oracle数据库。
当存在未处理的异常时,Elmah在Oracle数据库上正确写入。
但是当我打电话给(log4net)。错误(" foo")时,Elmah完全忽略了它。
这是我的配置:
<elmah>
<security allowRemoteAccess="false" />
<errorLog type="Elmah.OracleErrorLog, Elmah" connectionStringName="DefaultConnection" applicationName="Euler" />
</elmah>
<log4net>
<appender name="elmahappender" type="elmahappender_log4net.ELMAHAppender, elmahappender_log4net">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
<UseNullContext>False</UseNullContext>
</appender>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="(directory)" />
<datePattern value="dd.MM.yyyy'.log'" />
<staticLogFileName value="false" />
<rollingStyle value="Composite" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10000KB" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="elmahappender" />
<appender-ref ref="RollingFileAppender" />
</root>
</log4net>
FileAppender可以工作和记录数据,但不是elmahappender。