You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Maciej Stiller (Jira)" <ji...@apache.org> on 2022/02/01 13:42:00 UTC

[jira] [Created] (LOG4NET-685) Broken XmlLayoutSchemaLog4j in

Maciej Stiller created LOG4NET-685:
--------------------------------------

             Summary: Broken XmlLayoutSchemaLog4j in 
                 Key: LOG4NET-685
                 URL: https://issues.apache.org/jira/browse/LOG4NET-685
             Project: Log4net
          Issue Type: Bug
          Components: Layouts
    Affects Versions: 2.0.14
         Environment: Windows 11 Professional
.NET Framework 4.5.2
            Reporter: Maciej Stiller
         Attachments: configuration.xml

After updating from version 2.0.8 to 2.0.14, using XmlLayoutSchemaLog4j seems to be broken resulting in a following error:
{noformat}
System.ArgumentException: Cannot set the namespace if Namespaces is 'false'.
   at System.Xml.XmlTextWriter.WriteStartElement(String prefix, String localName, String ns)
   at log4net.Layout.XmlLayoutSchemaLog4j.FormatXml(XmlWriter writer, LoggingEvent loggingEvent)
   at log4net.Layout.XmlLayoutBase.Format(TextWriter writer, LoggingEvent loggingEvent)
   at log4net.Appender.AppenderSkeleton.RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent)
   at log4net.Appender.TextWriterAppender.Append(LoggingEvent loggingEvent)
   at log4net.Appender.FileAppender.Append(LoggingEvent loggingEvent)
   at log4net.Appender.RollingFileAppender.Append(LoggingEvent loggingEvent){noformat}
Configuration is initialized by executing XmlConfigurator, where Stream is pointing to [^configuration.xml]
{code:java}
log4net.Config.XmlConfigurator.Configure(Stream configStream); {code}
After some digging I belive for it to be related to [https://github.com/apache/logging-log4net/pull/18] which was introduces in version 2.0.13 under Bug fixes section



--
This message was sent by Atlassian Jira
(v8.20.1#820001)