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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.12
    • Component/s: Appenders
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: