Log4j 2
  1. Log4j 2
  2. LOG4J2-179

Add Logger interface APIs to log at given levels

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • 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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development