Github user dpsenner commented on a diff in the pull request:

    https://github.com/apache/logging-log4net/pull/22#discussion_r192367542
  
    --- Diff: src/Layout/XmlLayoutSchemaLog4jNS.cs ---
    @@ -0,0 +1,282 @@
    +#region Apache License
    +//
    +// Licensed to the Apache Software Foundation (ASF) under one or more
    +// contributor license agreements. See the NOTICE file distributed with
    +// this work for additional information regarding copyright ownership.
    +// The ASF licenses this file to you under the Apache License, Version 2.0
    +// (the "License"); you may not use this file except in compliance with
    +// the License. You may obtain a copy of the License at
    +//
    +// http://www.apache.org/licenses/LICENSE-2.0
    +//
    +// Unless required by applicable law or agreed to in writing, software
    +// distributed under the License is distributed on an "AS IS" BASIS,
    +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +// See the License for the specific language governing permissions and
    +// limitations under the License.
    +//
    +#endregion
    +
    +using System;
    +using System.Text;
    +using System.Xml;
    +using System.IO;
    +
    +using log4net.Core;
    +using log4net.Util;
    +
    +namespace log4net.Layout
    +{
    +   /// <summary>
    +   /// Layout that formats the log events as XML elements similar to the 
log4j 1.2 schema
    +   /// </summary>
    +   /// <remarks>
    +   /// <para>
    +   /// Formats the log events according to the
    +   /// http://logging.apache.org/log4j schema and actually puts the
    +   /// elements into a namespace. This may break tooling that doesn't
    +   /// handle XML using namespaces.
    +   /// </para>
    +   /// </remarks>
    +   /// <author>Nicko Cadell</author>
    +   public class XmlLayoutSchemaLog4jNS : XmlLayoutBaseNS
    --- End diff --
    
    So here we could actually really make use of a `XmlFormatter` class that 
provides mechanisms to format logging events in various formats. To mention a 
few we're already having today:
    
    * log4j_1.2
    * log4j_1.2_with_namespace
    
    This could be provided by one and only one layout (XmlLayoutSchemaLog4j?) 
which in turn can be configured to either be in format 1.2 or 1.2 with 
namespaces etc.. This would also create a place for future 2.0 layouts to live 
in. What do you think?


---

Reply via email to