我收到一个 NHibernate 异常,我想尝试获取更多信息,但它似乎没有记录错误。我实际上是在寻找更详细的错误信息,但发现了根本不记录错误的初始问题。
这是我的 log4net 部分来自 rom 配置文件:
<log4net>
<appender name="NHibernateAppender" type="log4net.Appender.RollingFileAppender">
<file value=".\\Logs\\NHibernate.log" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10000KB" />
<rollingStyle value="Size" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
" />
<footer value="[Footer]
" />
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="NHibernateSQLAppender" type="log4net.Appender.RollingFileAppender">
<file value=".\\Logs\\NHibernate.Sql.log" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10000KB" />
<rollingStyle value="Size" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
" />
<footer value="[Footer]
" />
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<logger name="NHibernate" additivity="false">
<level value="ERROR" />
<appender-ref ref="NHibernateAppender" />
</logger>
<logger name="NHibernate.SQL" additivity="false">
<level value="ERROR" />
<appender-ref ref="NHibernateSQLAppender" />
</logger>
</log4net>
我也试过“ALL”;它写入“DEBUG”和“INFO”,但没有“ERROR”条目。有什么建议么?谢谢!