@@ -125,7 +125,7 @@ private void WriteEvent(LogEvent logEvent, XmlWriter writer)
125
125
WriteProperties ( logEvent , writer , properties , machineNameProperty ) ;
126
126
}
127
127
WriteMessage ( logEvent , writer ) ;
128
- WriteException ( logEvent , writer , UsesLog4JCompatibility ? "throwable" : "exception" ) ;
128
+ WriteException ( logEvent , writer ) ;
129
129
writer . WriteEndElement ( ) ;
130
130
}
131
131
@@ -358,10 +358,9 @@ private void WriteMessage(LogEvent logEvent, XmlWriter writer)
358
358
/// </summary>
359
359
/// <param name="logEvent">The log event.</param>
360
360
/// <param name="writer">The XML writer.</param>
361
- /// <param name="elementName">The element name, should be either <c>exception</c> or <c>throwable</c>.</param>
362
361
/// <remarks>https://github.com/apache/logging-log4net/blob/rel/2.0.8/src/Layout/XmlLayout.cs#L288-L295</remarks>
363
362
[ SuppressMessage ( "Microsoft.Design" , "CA1031" , Justification = "Protecting from user-provided code which might throw anything" ) ]
364
- private void WriteException ( LogEvent logEvent , XmlWriter writer , string elementName )
363
+ private void WriteException ( LogEvent logEvent , XmlWriter writer )
365
364
{
366
365
var exception = logEvent . Exception ;
367
366
if ( exception == null )
@@ -380,6 +379,7 @@ private void WriteException(LogEvent logEvent, XmlWriter writer, string elementN
380
379
}
381
380
if ( formattedException != null )
382
381
{
382
+ var elementName = UsesLog4JCompatibility ? "throwable" : "exception" ;
383
383
WriteContent ( writer , elementName , formattedException ) ;
384
384
}
385
385
}
0 commit comments