Class Log
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringCompute the filename of the log file.static StringCompute the full path of the log file.static tokyo.northside.logging.ILoggerstatic StringReturns the path to the log file.static Stringstatic ZonedDateTimestatic booleanChecks whether debug-level logging is currently enabled.static voidLogs what otherwise would go to System.outstatic voidLogs an Exception or Error.static voidstatic voidLogs a debug message with optional parameters.static voidDeprecated, for removal: This API element is subject to removal in a future version.static voidlogErrorRB(String key, @Nullable Object parameter) Writes an error message to the log (to be retrieved from the resource bundle).static voidlogErrorRB(String key, @Nullable Object... parameters) Writes an error message to the log (to be retrieved from the resource bundle)static voidlogErrorRB(Throwable ex, String key, @Nullable Object... parameters) Writes an error message to the log (to be retrieved from the resource bundle).static voidWrites an info message to the log (to be retrieved from the resource bundle).static voidWrites an info message to the log (to be retrieved from the resource bundle).static voidWrites an info message to the log (to be retrieved from the resource bundle).static voidLogs a message, retrieved from the resource bundle.static voidlogWarningRB(String key, @Nullable Object parameter) Writes a warning message to the log (to be retrieved from the resource bundle).static voidlogWarningRB(String key, @Nullable Object... parameters) Writes a warning message to the log (to be retrieved from the resource bundle)static voidSet the level for the global logger.
-
Method Details
-
getSessionId
-
getSessionStartDateTime
-
getLogLocation
Returns the path to the log file. -
getLogFileName
Compute the filename of the log file.- Returns:
- the filename of the log, or an empty string
-
getLogFilePath
Compute the full path of the log file.- Returns:
- the full path of the log file
-
setLevel
Set the level for the global logger. This is normally determined by thelogger.propertiesfile; use this method to override for special use cases.- Parameters:
level- The new level
-
getLogger
-
log
Logs what otherwise would go to System.out -
logRB
Logs a message, retrieved from the resource bundle.- Parameters:
key- The key of the message in the resource bundle.parameters- Parameters for the message. These are inserted by using StaticUtils.format.
-
log
Logs an Exception or Error. To the log are written: - The class name of the Exception or Error - The message, if any - The stack trace- Parameters:
throwable- The exception or error to log
-
log
-
logWarningRB
Writes a warning message to the log (to be retrieved from the resource bundle)While the warning message can be localized, the warning key is also logged, so developers can determine what warning was given by looking at the error key, instead of trying to interpret localized messages.
- Parameters:
key- The key of the error message in the resource bundleparameters- Parameters for the error message. These are inserted by using StaticUtils.format.
-
logInfoRB
Writes an info message to the log (to be retrieved from the resource bundle).While the info message can be localized, the info key is also logged, so developers can determine what info was given by looking at the error key, instead of trying to interpret localized messages.
- Parameters:
key- The key of the error message in the resource bundleparameters- Parameters for the error message. These are inserted by using StaticUtils.format.
-
logErrorRB
Writes an error message to the log (to be retrieved from the resource bundle)While the error message can be localized, the error key is also logged, so developers can determine what error was given by looking at the error key, instead of trying to interpret localized messages.
- Parameters:
key- The key of the error message in the resource bundleparameters- Parameters for the error message. These are inserted by using StaticUtils.format.
-
logErrorRB
Writes an error message to the log (to be retrieved from the resource bundle).While the error message can be localized, the error key is also logged, so developers can determine what error was given by looking at the error key, instead of trying to interpret localized messages.
- Parameters:
ex- The error that was thrownkey- The key of the error message in the resource bundleparameters- Parameters for the error message. These are inserted by using StaticUtils.format.
-
logDebug
@Deprecated(since="6.1.0", forRemoval=true) public static void logDebug(Logger logger, String message, @Nullable @Nullable Object... parameters) Deprecated, for removal: This API element is subject to removal in a future version.Writes a debug message to log (without localization).- Parameters:
message- message textparameters- Parameters for the error message. These are inserted by using StaticUtils.format.
-
isDebugEnabled
public static boolean isDebugEnabled()Checks whether debug-level logging is currently enabled.- Returns:
- true if debug-level logging is enabled, false otherwise
-
logDebug
Logs a debug message with optional parameters. This method uses the debug logging level to record the provided message and arguments.- Parameters:
message- The message template to be logged. It may include placeholders for arguments.parameters- Optional arguments to be inserted into the placeholders of the message template.
-
logInfoRB
Writes an info message to the log (to be retrieved from the resource bundle).- Parameters:
key- The key of the error message in the resource bundleparameter- Parameter for the error message.
-
logInfoRB
Writes an info message to the log (to be retrieved from the resource bundle).- Parameters:
key- The key of the error message in the resource bundle
-
logWarningRB
Writes a warning message to the log (to be retrieved from the resource bundle).- Parameters:
key- The key of the error message in the resource bundleparameter- Parameter for the error message.
-
logErrorRB
Writes an error message to the log (to be retrieved from the resource bundle).
-