Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-383

Log4Net.Error throws VerificationException - Operation could destabilize the runtime

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2.10, 1.2.11
    • 1.2.12
    • None
    • None
    • IIS 7.5 / Win 2008 R2
      .Net 4.0
      MVC3 and WCF applications

    Description

      We are running into this issue when we log errors/fatal message using log4net.

      > System.Security.VerificationException: Operation could destabilize the
      > runtime. at log4net.Core.LogImpl.Fatal(Object message, Exception
      > exception)

      Strangely this happens only when we log as Error/Fatal, Info and Debug messages log perfectly fine. Because of this exception, the real exceptions are getting masked and its making it very hard for us to debug in deployed environments.

      I have tried searching online but to no avail. Any help is appreciated.

      Environment details:

      IIS 7.5 / Win 2008 R2
      .Net 4.0
      MVC3 and WCF applications

      Here is the logging configuration-

      <?xml version="1.0" encoding="utf-8" ?>
      <configuration>
      <configSections>
      <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
      </configSections>
      <log4net>
      <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
      <file value="C:\Logs\ApplicationServices.log" />
      <staticLogFileName value="true" />
      <appendToFile value="true" />
      <datePattern value="yyyyMMdd" />
      <rollingStyle value="Date" />
      <filter type="log4net.Filter.LevelRangeFilter">
      <acceptOnMatch value="true" />
      <levelMin value="DEBUG" />
      <levelMax value="FATAL" />
      </filter>
      <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="${COMPUTERNAME} %date %-5level %class.%method - %message%newline"/>
      </layout>
      </appender>
      <root>
      <level value="DEBUG"/>
      <appender-ref ref="RollingLogFileAppender" />
      </root>
      </log4net>
      </configuration>

      Attachments

        Activity

          People

            Unassigned Unassigned
            arunsun Arun
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: