Log4j 2
  1. Log4j 2
  2. LOG4J2-179

Add Logger interface APIs to log at given levels

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta4
    • Fix Version/s: 2.0-beta5
    • Component/s: None
    • Labels:

      Description

      The interface org.apache.logging.log4j.Logger contains the method boolean "isEnabled(Level level)" which is very nice.

      I would have expected it to also contain the following methods:

      boolean isEnabled(Level level, Marker marker);
      void log(Level level, Marker marker, Message msg);
      void log(Level level, Marker marker, Message msg, Throwable t);
      void log(Level level, Marker marker, Object message);
      void log(Level level, Marker marker, Object message, Throwable t);
      void log(Level level, Marker marker, String message);
      void log(Level level, Marker marker, String message, Object... params);
      void log(Level level, Marker marker, String message, Throwable t);
      void log(Level level, Message msg);
      void log(Level level, Message msg, Throwable t);
      void log(Level level, Object message);
      void log(Level level, Object message, Throwable t);
      void log(Level level, String message);
      void log(Level level, String message, Object... params);
      void log(Level level, String message, Throwable t);
      (i.e. every method defined for an explicit level but just with an Level as the first argument)

      That way it would be easier to log at a variable level in cases where the level to be used can only be determined at runtime.

        Activity

        Joern Huxhorn created issue -
        Gary Gregory made changes -
        Field Original Value New Value
        Summary Logger interface is lacking methods for logging at variable level Add Logger interface APIs to log at given levels
        Gary Gregory made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0-beta5 [ 12323970 ]
        Resolution Fixed [ 1 ]
        Gary Gregory made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Ralph Goers made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Assignee Ralph Goers [ ralph.goers@dslextreme.com ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Ralph Goers
            Reporter:
            Joern Huxhorn
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development