Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-106

TraceAppender : Add switch to disable using logger name as trace category

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 1.2.9
    • 1.2.11
    • Appenders
    • None

    Description

      TraceAppender now always put logger name as trace category when writing to System.Diagnostics.Trace.Write
      ie. :
      System.Diagnostics.Trace.Write(RenderLoggingEvent(loggingEvent), loggingEvent.LoggerName);

      This resulted in logger's name appearing twice in Trace logs if once use/share the same conversion for both file-based and trace appenders, eg.
      "%date [%thread] %-5level %logger - %message%"

      It would be nice to have a settable property on TraceAppender to disable using logger's name as trace category, ie. :

      public bool UseLoggerNameAsTraceCategory
      {
      get; set;
      }

      ...
      if (m_useLoggerNameAsTraceCategory)
      {
      System.Diagnostics.Trace.Write(RenderLoggingEvent(loggingEvent), loggingEvent.LoggerName);
      }
      else
      {
      System.Diagnostics.Trace.Write(RenderLoggingEvent(loggingEvent), null);
      }

      Attachments

        Issue Links

          Activity

            People

              ron liu ron
              chilang Chi Lang
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: