相同的 log4net appender azure nuget
代码在 console app,
but not working in MVC application
中工作正常。
我正在使用此Nuget log4net.Appender.Azure 1.1.1
已经在global.asax中添加了 log4net.Config.XmlConfigurator.Configure();
web.config
<log4net>
<!-- Azure Table Appender, uncomment, set proper QueueName and AWS credentials (appSettings) to try it out -->
<appender name="AzureAppender1" type="log4net.Appender.AzureTableAppender, log4net.Appender.Azure">
<param name="TableName" value="test" />
<param name="ConnectionString" value="***" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
谁能知道为什么它不起作用?
我不确定 - 但是对于大型记录场景,我会谨慎地谨慎。查看本表设计指南中的记录反图案。它通常会导致热分区 - 通常,使用斑点可以更好地支持该场景。
这里,我们发现这是问题OD log4net dll版本。在nuget log4net appender azure
log4net
DLL的版本中, 1.2.12
是较旧的。需要更新到更新版本1.2.13
解决上述问题。