Package com.oorian

Class OorianLog

java.lang.Object
com.oorian.OorianLog

public final class OorianLog extends Object
Logging facade for the Oorian framework, backed by the System.Logger SPI.

OorianLog provides a lightweight, instance-based logging API that delegates to the JDK's System.Logger platform. End users can plug in any logging backend (SLF4J, Log4j2, java.util.logging, etc.) by providing a System.LoggerFinder on the module path or classpath.

Usage:


 private static final OorianLog LOG = OorianLog.getLogger(MyClass.class);

 LOG.info("Application started");
 LOG.debug("Processing request for page {0}", pageId);
 LOG.error("Failed to load resource", exception);
 

Logging Levels:

  • trace – per-message operations, heartbeats, pings
  • debug – request routing, connection open/close, session lifecycle
  • info – lifecycle events: startup, shutdown, license status
  • warning – recoverable issues, security events, missing resources
  • error – exceptions and failures that affect functionality
Since:
2021
Version:
2.0
Author:
Marvin P. Warble Jr.
  • Method Details

    • getLogger

      public static OorianLog getLogger(Class<?> clazz)
      Creates a new OorianLog instance for the specified class.
      Parameters:
      clazz - The class that will use this logger instance.
      Returns:
      A new OorianLog backed by a System.Logger named after the class.
    • isLoggable

      public boolean isLoggable(System.Logger.Level level)
      Checks whether a message at the given level would be logged.

      Use this to guard expensive message construction.

      Parameters:
      level - The level to check.
      Returns:
      true if the level is currently enabled.
    • trace

      public void trace(String msg)
      Logs a TRACE-level message.
      Parameters:
      msg - The message to log.
    • trace

      public void trace(String msg, Throwable thrown)
      Logs a TRACE-level message with an associated throwable.
      Parameters:
      msg - The message to log.
      thrown - The throwable to log.
    • trace

      public void trace(String format, Object... args)
      Logs a TRACE-level message with parameters using MessageFormat syntax.
      Parameters:
      format - The message format string (e.g., "Processing {0} items").
      args - The format arguments.
    • debug

      public void debug(String msg)
      Logs a DEBUG-level message.
      Parameters:
      msg - The message to log.
    • debug

      public void debug(String msg, Throwable thrown)
      Logs a DEBUG-level message with an associated throwable.
      Parameters:
      msg - The message to log.
      thrown - The throwable to log.
    • debug

      public void debug(String format, Object... args)
      Logs a DEBUG-level message with parameters using MessageFormat syntax.
      Parameters:
      format - The message format string.
      args - The format arguments.
    • info

      public void info(String msg)
      Logs an INFO-level message.
      Parameters:
      msg - The message to log.
    • info

      public void info(String msg, Throwable thrown)
      Logs an INFO-level message with an associated throwable.
      Parameters:
      msg - The message to log.
      thrown - The throwable to log.
    • info

      public void info(String format, Object... args)
      Logs an INFO-level message with parameters using MessageFormat syntax.
      Parameters:
      format - The message format string.
      args - The format arguments.
    • warning

      public void warning(String msg)
      Logs a WARNING-level message.
      Parameters:
      msg - The message to log.
    • warning

      public void warning(String msg, Throwable thrown)
      Logs a WARNING-level message with an associated throwable.
      Parameters:
      msg - The message to log.
      thrown - The throwable to log.
    • warning

      public void warning(String format, Object... args)
      Logs a WARNING-level message with parameters using MessageFormat syntax.
      Parameters:
      format - The message format string.
      args - The format arguments.
    • error

      public void error(String msg)
      Logs an ERROR-level message.
      Parameters:
      msg - The message to log.
    • error

      public void error(String msg, Throwable thrown)
      Logs an ERROR-level message with an associated throwable.
      Parameters:
      msg - The message to log.
      thrown - The throwable to log.
    • error

      public void error(String format, Object... args)
      Logs an ERROR-level message with parameters using MessageFormat syntax.
      Parameters:
      format - The message format string.
      args - The format arguments.