You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Davyd McColl (Jira)" <ji...@apache.org> on 2022/07/22 12:55:00 UTC
[jira] [Resolved] (LOG4NET-685) Broken XmlLayoutSchemaLog4j
[ https://issues.apache.org/jira/browse/LOG4NET-685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Davyd McColl resolved LOG4NET-685.
----------------------------------
Resolution: Fixed
> Broken XmlLayoutSchemaLog4j
> ---------------------------
>
> 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, Windows 10 Professional, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019
> .NET Framework 4.5.2
> Reporter: Maciej Stiller
> Priority: Major
> Labels: layout, namespace, namespaces, schema, xml
> 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 introduced in version 2.0.13 under Bug fixes section
--
This message was sent by Atlassian Jira
(v8.20.10#820010)