@@ -160,7 +160,6 @@ public bool Base64EncodeProperties
160160 set { m_base64Properties = value ; }
161161 }
162162
163-
164163 #endregion Public Instance Properties
165164
166165 #region Implementation of IOptionHandler
@@ -199,7 +198,7 @@ public override void ActivateOptions()
199198 m_elmLocation = m_prefix + ":" + ELM_LOCATION ;
200199 }
201200 }
202-
201+
203202 #endregion Implementation of IOptionHandler
204203
205204 #region Override implementation of XMLLayoutBase
@@ -217,7 +216,12 @@ public override void ActivateOptions()
217216 /// </remarks>
218217 protected override void FormatXml ( XmlWriter writer , LoggingEvent loggingEvent )
219218 {
219+ #if NETSTANDARD
220+ writer . WriteStartElement ( m_prefix , ELM_EVENT , m_prefix ) ;
221+ // writer.WriteAttributeString("xmlns", "log4net", null, "http://logging.apache.org/log4net/schemas/log4net-events-1.2");
222+ #else
220223 writer . WriteStartElement ( m_elmEvent ) ;
224+ #endif
221225 writer . WriteAttributeString ( ATTR_LOGGER , loggingEvent . LoggerName ) ;
222226
223227#if NET_2_0 || NETCF_2_0 || MONO_2_0 || NETSTANDARD
@@ -243,7 +247,11 @@ protected override void FormatXml(XmlWriter writer, LoggingEvent loggingEvent)
243247 }
244248
245249 // Append the message text
250+ #if NETSTANDARD
251+ writer . WriteStartElement ( m_prefix , ELM_MESSAGE , m_prefix ) ;
252+ #else
246253 writer . WriteStartElement ( m_elmMessage ) ;
254+ #endif
247255 if ( ! this . Base64EncodeMessage )
248256 {
249257 Transform . WriteEscapedXmlString ( writer , loggingEvent . RenderedMessage , this . InvalidCharReplacement ) ;
@@ -261,10 +269,18 @@ protected override void FormatXml(XmlWriter writer, LoggingEvent loggingEvent)
261269 // Append the properties text
262270 if ( properties . Count > 0 )
263271 {
272+ #if NETSTANDARD
273+ writer . WriteStartElement ( m_prefix , ELM_PROPERTIES , m_prefix ) ;
274+ #else
264275 writer . WriteStartElement ( m_elmProperties ) ;
276+ #endif
265277 foreach ( System . Collections . DictionaryEntry entry in properties )
266278 {
279+ #if NETSTANDARD
280+ writer . WriteStartElement ( m_prefix , ELM_DATA , m_prefix ) ;
281+ #else
267282 writer . WriteStartElement ( m_elmData ) ;
283+ #endif
268284 writer . WriteAttributeString ( ATTR_NAME , Transform . MaskXmlInvalidCharacters ( ( string ) entry . Key , this . InvalidCharReplacement ) ) ;
269285
270286 // Use an ObjectRenderer to convert the object to a string
@@ -289,7 +305,11 @@ protected override void FormatXml(XmlWriter writer, LoggingEvent loggingEvent)
289305 if ( exceptionStr != null && exceptionStr . Length > 0 )
290306 {
291307 // Append the stack trace line
308+ #if NETSTANDARD
309+ writer . WriteStartElement ( m_prefix , ELM_EXCEPTION , m_prefix ) ;
310+ #else
292311 writer . WriteStartElement ( m_elmException ) ;
312+ #endif
293313 Transform . WriteEscapedXmlString ( writer , exceptionStr , this . InvalidCharReplacement ) ;
294314 writer . WriteEndElement ( ) ;
295315 }
@@ -298,7 +318,11 @@ protected override void FormatXml(XmlWriter writer, LoggingEvent loggingEvent)
298318 {
299319 LocationInfo locationInfo = loggingEvent . LocationInformation ;
300320
321+ #if NETSTANDARD
322+ writer . WriteStartElement ( m_prefix , ELM_LOCATION , m_prefix ) ;
323+ #else
301324 writer . WriteStartElement ( m_elmLocation ) ;
325+ #endif
302326 writer . WriteAttributeString ( ATTR_CLASS , locationInfo . ClassName ) ;
303327 writer . WriteAttributeString ( ATTR_METHOD , locationInfo . MethodName ) ;
304328 writer . WriteAttributeString ( ATTR_FILE , locationInfo . FileName ) ;
0 commit comments