Class JettyLogger

java.lang.Object
org.apache.juneau.microservice.jetty.JettyLogger
All Implemented Interfaces:
org.slf4j.Logger, org.slf4j.spi.LocationAwareLogger

public class JettyLogger extends Object implements org.slf4j.spi.LocationAwareLogger
Implementation of Jetty Logger based on Logger.

Allows Jetty to log to the Java Util logging framework (and thus to the main log file defined in the [Logging] section).

Can be used by setting the following system property in the microservice config file.

[SystemProperties] # Configure Jetty to log using java-util logging org.eclipse.jetty.util.log.class = org.apache.juneau.microservice.jetty.JettyLogger

See Also:
  • Constructor Details

    • JettyLogger

      public JettyLogger()
      Default constructor.

      Returns the logger with name "org.eclipse.jetty.util.log.javautil".

    • JettyLogger

      public JettyLogger(String name)
      Normal constructor.
      Parameters:
      name - The logger name.
  • Method Details

    • debug

      public void debug(org.slf4j.Marker marker, String msg)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String format, Object... arguments)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String msg, Throwable t)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String msg)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String msg, long arg)
      Logs a debug message with a long argument.
      Parameters:
      msg - The message template with "{}" placeholder.
      arg - The long argument to substitute into the message.
    • debug

      public void debug(String msg, Object... args)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String format, Object arg)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String format, Object arg1, Object arg2)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String msg, Throwable thrown)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(Throwable thrown)
      Logs a debug message with only a throwable.
      Parameters:
      thrown - The throwable to log.
    • error

      public void error(org.slf4j.Marker marker, String msg)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String format, Object... arguments)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String msg, Throwable t)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String msg)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String format, Object arg)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String format, Object... arguments)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String format, Object arg1, Object arg2)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String msg, Throwable t)
      Specified by:
      error in interface org.slf4j.Logger
    • getLogger

      public JettyLogger getLogger(String name)
      Creates a child logger with the specified name.
      Parameters:
      name - The logger name.
      Returns:
      A new JettyLogger instance for the specified name.
    • getName

      public String getName()
      Specified by:
      getName in interface org.slf4j.Logger
    • ignore

      public void ignore(Throwable ignored)
      Logs an ignored exception at the FINEST level.
      Parameters:
      ignored - The exception to log as ignored.
    • info

      public void info(org.slf4j.Marker marker, String msg)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String format, Object... arguments)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String msg, Throwable t)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String msg)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String msg, Object... args)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String format, Object arg)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String format, Object arg1, Object arg2)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String msg, Throwable thrown)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(Throwable thrown)
      Logs an info message with only a throwable.
      Parameters:
      thrown - The throwable to log.
    • isDebugEnabled

      public boolean isDebugEnabled()
      Specified by:
      isDebugEnabled in interface org.slf4j.Logger
    • isDebugEnabled

      public boolean isDebugEnabled(org.slf4j.Marker marker)
      Specified by:
      isDebugEnabled in interface org.slf4j.Logger
    • isErrorEnabled

      public boolean isErrorEnabled()
      Specified by:
      isErrorEnabled in interface org.slf4j.Logger
    • isErrorEnabled

      public boolean isErrorEnabled(org.slf4j.Marker marker)
      Specified by:
      isErrorEnabled in interface org.slf4j.Logger
    • isInfoEnabled

      public boolean isInfoEnabled()
      Specified by:
      isInfoEnabled in interface org.slf4j.Logger
    • isInfoEnabled

      public boolean isInfoEnabled(org.slf4j.Marker marker)
      Specified by:
      isInfoEnabled in interface org.slf4j.Logger
    • isTraceEnabled

      public boolean isTraceEnabled()
      Specified by:
      isTraceEnabled in interface org.slf4j.Logger
    • isTraceEnabled

      public boolean isTraceEnabled(org.slf4j.Marker marker)
      Specified by:
      isTraceEnabled in interface org.slf4j.Logger
    • isWarnEnabled

      public boolean isWarnEnabled()
      Specified by:
      isWarnEnabled in interface org.slf4j.Logger
    • isWarnEnabled

      public boolean isWarnEnabled(org.slf4j.Marker marker)
      Specified by:
      isWarnEnabled in interface org.slf4j.Logger
    • log

      public void log(org.slf4j.Marker marker, String fqcn, int level, String message, Object[] argArray, Throwable t)
      Specified by:
      log in interface org.slf4j.spi.LocationAwareLogger
    • setDebugEnabled

      public void setDebugEnabled(boolean enabled)
      Enables or disables debug logging.

      When enabled, sets the log level to FINE. When disabled, restores the previously configured log level.

      Parameters:
      enabled - true to enable debug logging, false to disable.
    • trace

      public void trace(org.slf4j.Marker marker, String msg)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String format, Object... argArray)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String msg, Throwable t)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String msg)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String format, Object arg)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String format, Object... arguments)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String format, Object arg1, Object arg2)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String msg, Throwable t)
      Specified by:
      trace in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String msg)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String format, Object... arguments)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String msg, Throwable t)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String msg)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String msg, Object... args)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String format, Object arg)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String format, Object arg1, Object arg2)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String msg, Throwable thrown)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(Throwable thrown)
      Logs a warning message with only a throwable.
      Parameters:
      thrown - The throwable to log.