예제 #1
0
        public override void Format(TextWriter writer, LoggingEvent loggingEvent)
        {
            if (loggingEvent == null)
            {
                throw new ArgumentNullException("loggingEvent");
            }

            loggingEvent.WriteRenderedMessage(writer);
            writer.WriteLine();
            if ( loggingEvent.ExceptionObject != null )
            {
                loggingEvent.ExceptionObject.DumpTo( writer );
            }
        }
예제 #2
0
        public override void Format( TextWriter writer, LoggingEvent loggingEvent )
        {
            if ( loggingEvent == null )
            {
                throw new ArgumentNullException( "loggingEvent" );
            }

            writer.Write( loggingEvent.TimeStamp.ToString( "yyyy-MM-dd HH:mm:ss" ) );
            writer.Write( "|" );
            writer.Write( loggingEvent.Level.DisplayName );
            writer.Write( "|" );
            writer.Write( loggingEvent.ThreadName );
            writer.Write( "|" );
            writer.Write( loggingEvent.LoggerName );
            writer.Write( ": " );
            loggingEvent.WriteRenderedMessage( writer );
            writer.WriteLine();

            if ( loggingEvent.ExceptionObject != null )
            {
                loggingEvent.ExceptionObject.DumpTo( writer );
            }
        }
예제 #3
0
		/// <summary>
		/// Produces a simple formatted output.
		/// </summary>
		/// <param name="loggingEvent">the event being logged</param>
		/// <param name="writer">The TextWriter to write the formatted event to</param>
		/// <remarks>
		/// <para>
		/// Formats the event as the level of the even,
		/// followed by " - " and then the log message itself. The
		/// output is terminated by a newline.
		/// </para>
		/// </remarks>
		override public void Format(TextWriter writer, LoggingEvent loggingEvent) 
		{
			if (loggingEvent == null)
			{
				throw new ArgumentNullException("loggingEvent");
			}

			writer.Write(loggingEvent.Level.DisplayName);
			writer.Write(" - ");
			loggingEvent.WriteRenderedMessage(writer);
			writer.WriteLine();
		}
예제 #4
0
			/// <summary>
			/// Convert the pattern to the rendered message
			/// </summary>
			/// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
			/// <param name="loggingEvent">the event being logged</param>
			/// <returns>the relevant location information</returns>
			override protected void Convert(System.IO.TextWriter writer, LoggingEvent loggingEvent)
			{
				loggingEvent.WriteRenderedMessage(writer);
			}
			/// <summary>
			/// Convert the pattern to the rendered message
			/// </summary>
			/// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
			/// <param name="loggingEvent">the event being logged</param>
			/// <returns>the relevant location information</returns>
			protected override void Convert(TextWriter writer, LoggingEvent loggingEvent)
			{
				loggingEvent.WriteRenderedMessage(writer);
			}