Class AbstractLogger

java.lang.Object
org.eclipse.jetty.util.log.AbstractLogger
All Implemented Interfaces:
Logger
Direct Known Subclasses:
JavaUtilLog, LoggerLog, Slf4jLog, StdErrLog

public abstract class AbstractLogger extends Object implements Logger
Abstract Logger. Manages the atomic registration of the logger by name.
  • Field Details

  • Constructor Details

    • AbstractLogger

      public AbstractLogger()
  • Method Details

    • getLogger

      public final Logger getLogger(String name)
      Specified by:
      getLogger in interface Logger
      Parameters:
      name - the name of the logger
      Returns:
      a logger with the given name
    • newLogger

      protected abstract Logger newLogger(String fullname)
    • isBlank

      private static boolean isBlank(String name)
      A more robust form of name blank test. Will return true for null names, and names that have only whitespace
      Parameters:
      name - the name to test
      Returns:
      true for null or blank name, false if any non-whitespace character is found.
    • lookupLoggingLevel

      public static int lookupLoggingLevel(Properties props, String name)
      Get the Logging Level for the provided log name. Using the FQCN first, then each package segment from longest to shortest.
      Parameters:
      props - the properties to check
      name - the name to get log for
      Returns:
      the logging level
    • getLoggingProperty

      public static String getLoggingProperty(Properties props, String name, String property)
    • getLevelId

      protected static int getLevelId(String levelSegment, String levelName)
    • condensePackageString

      protected static String condensePackageString(String classname)
      Condenses a classname by stripping down the package name to just the first character of each package name segment.Configured
       Examples:
       "org.eclipse.jetty.test.FooTest"           = "oejt.FooTest"
       "org.eclipse.jetty.server.logging.LogTest" = "orjsl.LogTest"
       
      Parameters:
      classname - the fully qualified class name
      Returns:
      the condensed name
    • debug

      public void debug(String msg, long arg)
      Description copied from interface: Logger
      Formats and logs at debug level. avoids autoboxing of integers
      Specified by:
      debug in interface Logger
      Parameters:
      msg - the formatting string
      arg - long value