Log4net
  1. Log4net
  2. LOG4NET-382

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker 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.

        Issue Links

          Activity

          Hide
          Dominik Psenner added a comment -

          Thanks for pointing this one out. Commited patch with revision: 1494880

          Can you confirm that this fixes the issue?

          Show
          Dominik Psenner added a comment - Thanks for pointing this one out. Commited patch with revision: 1494880 Can you confirm that this fixes the issue?
          Hide
          Simon Chester added a comment -

          Hi Dominik,

          Thank you for the fix. I passed this over to one of my devs and he tells me that this has fixed the problem.

          Thanks,

          Simon.

          Show
          Simon Chester added a comment - Hi Dominik, Thank you for the fix. I passed this over to one of my devs and he tells me that this has fixed the problem. Thanks, Simon.
          Hide
          Dominik Psenner added a comment -

          Closing the issue due to the comment of Simon Chester.

          Show
          Dominik Psenner added a comment - Closing the issue due to the comment of Simon Chester.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development