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

          Simon Chester created issue -
          Simon Chester made changes -
          Field Original Value New Value
          Link This issue is broken by LOG4NET-360 [ LOG4NET-360 ]
          Dominik Psenner made changes -
          Assignee Dominik Psenner [ nachbarslumpi ]
          Dominik Psenner made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          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?
          Dominik Psenner made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          Fix Version/s 1.2.12 [ 12318546 ]
          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.
          Dominik Psenner made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          22h 38m 1 Dominik Psenner 20/Jun/13 08:31
          In Progress In Progress Resolved Resolved
          2m 45s 1 Dominik Psenner 20/Jun/13 08:34
          Resolved Resolved Closed Closed
          4d 4h 22m 1 Dominik Psenner 24/Jun/13 12:56

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development