[ 
https://issues.apache.org/jira/browse/LOG4NET-586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17480886#comment-17480886
 ] 

Davyd McColl commented on LOG4NET-586:
--------------------------------------

I've just seen similar behavior in the log4net xml layout, and it seems that a 
similar fix to what is in the log4j on (using the namespaced calls) is probably 
fit for netstandard, however, I'd like to maintain the older behavior on older 
.net framework targets, to which end I put all the new variants compiled only 
for NETSTANDARD targets - and I've updated this layout to have the same 
behavior as the new behavior was being imposed on all users. I hope this will 
find an acceptable middle-ground of functionality.

> XmlLayoutSchemaLog4j throws exception under .Net Core
> -----------------------------------------------------
>
>                 Key: LOG4NET-586
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-586
>             Project: Log4net
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.8
>         Environment: .Net Core 1.1 on Windows
>            Reporter: Pierre-Yann Bridé
>            Priority: Major
>             Fix For: 2.1.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Hi,
> When using XmlLayoutSchemaLog4j layout with .Net Core, the following 
> exception appears:
> {code:java}
> {quote}System.ArgumentException: Invalid name character in 'log4j:event'. The 
> ':' character, hexadecimal value 0x0x3A, cannot be included in a name.{quote}
> {code}
> I made a copy of XmlLayoutSchemaLog4j.cs in my sources, and found the culprit:
> {code:java}
> writer.WriteStartElement("log4j:event");
> {code}
> XmlWriter.WriteStartElement is called wrongly, the namespace should be a 
> separate argument:
> {code:java}
> writer.WriteStartElement("event", "log4j");
> {code}
> I corrected all WriteStartElement in my copy, and it now works fine. I hope 
> that you can put this small change in the next version.



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

Reply via email to