Neo
Neo

Reputation: 16239

log4net not working using log4net appender azure in MVC applcation

same log4net appender azure nuget code working fine for console app, but not working in MVC application.

I'm using this nuget log4net.Appender.Azure 1.1.1

already added log4net.Config.XmlConfigurator.Configure(); in Global.asax 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>

Can anyone know why it is not working ?

Upvotes: 2

Views: 2088

Answers (2)

Neo
Neo

Reputation: 16239

Here we go I found that it is problem od log4net dll version. in nuget log4net appender azure version of log4net dll is 1.2.12 it is the older one. need should be updated to newer version 1.2.13

that solves the above issue.

Upvotes: 1

Jason Hogg - MSFT
Jason Hogg - MSFT

Reputation: 1378

I am not sure - but I would be a little careful about using Tables for large scale logging scenarios. Take a look at the logging anti-pattern in this Table Design Guide. It can often lead to hot partitions - and often times the scenario is much better supported using Blobs.

Upvotes: 3

Related Questions