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

TargetInvocationException occurs because MESSAGE_SIZE fields in EventLogAppender are initialized in wrong order

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 1.2.12
    • Appenders
    • None

    Description

      In log4net.Appender.EventLogAppender:

      The MAX_EVENTLOG_MESSAGE_SIZE field is initiated before MAX_EVENTLOG_MESSAGE_SIZE_DEFAULT and MAX_EVENTLOG_MESSAGE_SIZE_VISTA_OR_NEWER. Therefore, when MAX_EVENTLOG_MESSAGE_SIZE is set during construction, MAX_EVENTLOG_MESSAGE_SIZE_DEFAULT and MAX_EVENTLOG_MESSAGE_SIZE_VISTA_OR_NEWER are zero.

      The end result is that a TargetInvocationException occurs in log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(System.Xml.XmlElement appenderElement) (Line 303) and that the message recorded in the event log is empty.

      Attachments

        Issue Links

          Activity

            People

              nachbarslumpi Dominik Psenner
              schester Simon Chester
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: