#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.IO; using log4net; using log4net.Core; namespace log4net.Layout { /// /// Interface implemented by layout objects /// /// /// /// An object is used to format a /// as text. The method is called by an /// appender to transform the into a string. /// /// /// The layout can also supply and /// text that is appender before any events and after all the events respectively. /// /// /// Nicko Cadell /// Gert Driesen public interface ILayout { /// /// Implement this method to create your own layout format. /// /// The TextWriter to write the formatted event to /// The event to format /// /// /// This method is called by an appender to format /// the as text and output to a writer. /// /// /// If the caller does not have a and prefers the /// event to be formatted as a then the following /// code can be used to format the event into a . /// /// /// StringWriter writer = new StringWriter(); /// Layout.Format(writer, loggingEvent); /// string formattedEvent = writer.ToString(); /// /// void Format(TextWriter writer, LoggingEvent loggingEvent); /// /// The content type output by this layout. /// /// The content type /// /// /// The content type output by this layout. /// /// /// This is a MIME type e.g. "text/plain". /// /// string ContentType { get; } /// /// The header for the layout format. /// /// the layout header /// /// /// The Header text will be appended before any logging events /// are formatted and appended. /// /// string Header { get; } /// /// The footer for the layout format. /// /// the layout footer /// /// /// The Footer text will be appended after all the logging events /// have been formatted and appended. /// /// string Footer { get; } /// /// Flag indicating if this layout handle exceptions /// /// false if this layout handles exceptions /// /// /// If this layout handles the exception object contained within /// , then the layout should return /// false. Otherwise, if the layout ignores the exception /// object, then the layout should return true. /// /// bool IgnoresException { get; } } }