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

Insufficient Granularity on Log methods in ILog

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.2.10
    • 1.3.0
    • Core
    • None
    • All Environments

    Description

      The driver for this change is that we are unable to log certain event types from the ILog object. While we can use the Logger object, it is easier to have them here.

      updated code:

      ILog.cs

      //start new
      void Emergency(object message);
      void Emergency(object message, Exception e);
      void Alert(object message);
      void Alert(object message, Exception e);
      void Critical(object message);
      void Critical(object message, Exception e);
      void Notice(object message);
      void Notice(object message, Exception e);
      //end new

      LogImpl.cs (in ReloadLevels)
      //start new
      m_levelEmergency = levelMap.LookupWithDefault(Level.Emergency);
      m_levelAlert = levelMap.LookupWithDefault(Level.Alert);
      m_levelCritical = levelMap.LookupWithDefault(Level.Critical);
      m_levelNotice = levelMap.LookupWithDefault(Level.Notice);
      //end new

      methods:
      //start new
      virtual public void Emergency(object message)

      { Logger.Log(ThisDeclaringType, m_levelEmergency, message, null); }

      virtual public void Emergency(object message, Exception exception)

      { Logger.Log(ThisDeclaringType, m_levelEmergency, message, exception); }

      virtual public void Alert(object message)

      { Logger.Log(ThisDeclaringType, m_levelAlert, message, null); }

      virtual public void Alert(object message, Exception exception)

      { Logger.Log(ThisDeclaringType, m_levelAlert, message, exception); }

      virtual public void Critical(object message)

      { Logger.Log(ThisDeclaringType, m_levelCritical, message, null); }

      virtual public void Critical(object message, Exception exception)

      { Logger.Log(ThisDeclaringType, m_levelCritical, message, exception); }

      virtual public void Notice(object message)

      { Logger.Log(ThisDeclaringType, m_levelNotice, message, null); }

      virtual public void Notice(object message, Exception exception)

      { Logger.Log(ThisDeclaringType, m_levelNotice, message, exception); }

      //end new

      private fields:
      //start new
      private Level m_levelEmergency;
      private Level m_levelAlert;
      private Level m_levelCritical;
      private Level m_levelNotice;
      //end new

      Attachments

        Activity

          People

            nachbarslumpi Dominik Psenner
            zbeckerman Zev
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified