Package com.oorian
Class OorianLog
java.lang.Object
com.oorian.OorianLog
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, pingsdebug– request routing, connection open/close, session lifecycleinfo– lifecycle events: startup, shutdown, license statuswarning– recoverable issues, security events, missing resourceserror– exceptions and failures that affect functionality
- Since:
- 2021
- Version:
- 2.0
- Author:
- Marvin P. Warble Jr.
-
Method Summary
Modifier and TypeMethodDescriptionvoidLogs a DEBUG-level message.voidLogs a DEBUG-level message with parameters usingMessageFormatsyntax.voidLogs a DEBUG-level message with an associated throwable.voidLogs an ERROR-level message.voidLogs an ERROR-level message with parameters usingMessageFormatsyntax.voidLogs an ERROR-level message with an associated throwable.static OorianLogCreates a new OorianLog instance for the specified class.voidLogs an INFO-level message.voidLogs an INFO-level message with parameters usingMessageFormatsyntax.voidLogs an INFO-level message with an associated throwable.booleanisLoggable(System.Logger.Level level) Checks whether a message at the given level would be logged.voidLogs a TRACE-level message.voidLogs a TRACE-level message with parameters usingMessageFormatsyntax.voidLogs a TRACE-level message with an associated throwable.voidLogs a WARNING-level message.voidLogs a WARNING-level message with parameters usingMessageFormatsyntax.voidLogs a WARNING-level message with an associated throwable.
-
Method Details
-
getLogger
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.Loggernamed after the class.
-
isLoggable
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:
trueif the level is currently enabled.
-
trace
Logs a TRACE-level message.- Parameters:
msg- The message to log.
-
trace
Logs a TRACE-level message with an associated throwable.- Parameters:
msg- The message to log.thrown- The throwable to log.
-
trace
Logs a TRACE-level message with parameters usingMessageFormatsyntax.- Parameters:
format- The message format string (e.g., "Processing {0} items").args- The format arguments.
-
debug
Logs a DEBUG-level message.- Parameters:
msg- The message to log.
-
debug
Logs a DEBUG-level message with an associated throwable.- Parameters:
msg- The message to log.thrown- The throwable to log.
-
debug
Logs a DEBUG-level message with parameters usingMessageFormatsyntax.- Parameters:
format- The message format string.args- The format arguments.
-
info
Logs an INFO-level message.- Parameters:
msg- The message to log.
-
info
Logs an INFO-level message with an associated throwable.- Parameters:
msg- The message to log.thrown- The throwable to log.
-
info
Logs an INFO-level message with parameters usingMessageFormatsyntax.- Parameters:
format- The message format string.args- The format arguments.
-
warning
Logs a WARNING-level message.- Parameters:
msg- The message to log.
-
warning
Logs a WARNING-level message with an associated throwable.- Parameters:
msg- The message to log.thrown- The throwable to log.
-
warning
Logs a WARNING-level message with parameters usingMessageFormatsyntax.- Parameters:
format- The message format string.args- The format arguments.
-
error
Logs an ERROR-level message.- Parameters:
msg- The message to log.
-
error
Logs an ERROR-level message with an associated throwable.- Parameters:
msg- The message to log.thrown- The throwable to log.
-
error
Logs an ERROR-level message with parameters usingMessageFormatsyntax.- Parameters:
format- The message format string.args- The format arguments.
-