Package io.pzstorm.storm.logging
Class StormLogger
java.lang.Object
io.pzstorm.storm.logging.StormLogger
Wrapper class for printing Storm logs with Log4j 2 logger.
To configure console logging level launch Storm with JVM_PROPERTY
set to a custom logger level and call initialize() method.
Logs will automatically be printed to console and configured log files.
Check log4j2.xml for log file locations. Use the static methods to
print logs with desired log level. If you want to print with a log level not covered
by static methods use get() method to get a reference to logger instance.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis handler will log an error with Log4J when a Thread abruptly terminates due to an uncaught exception. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidLogs a message object with theDEBUGlevel.static voidLogs a formatted message withDEBUGlevel using the specified format string and arguments.static voidstatic voidLogs a message object with theVERBOSElevel.static voidLogs a formatted message withVERBOSElevel using the specified format string and arguments.static voidLogs a message object with theERRORlevel.static voidLogs a formatted message withERRORlevel using the specified format string and arguments.static voidstatic org.apache.logging.log4j.Loggerget()Returns an instance of Log4jLoggerused for logging.static voidLogs a message object with theINFOlevel.static voidLogs a formatted message withINFOlevel using the specified format string and arguments.static voidInitializeStormLoggersystem by setting logging level resolved from system properties.static voidLogs a formatted message using the specified format string and arguments.static voidLogs a message object with theWARNlevel.static voidLogs a formatted message withWARNlevel using the specified format string and arguments.
-
Field Details
-
VERBOSE
public static final org.apache.logging.log4j.Level VERBOSE
-
-
Method Details
-
initialize
public static void initialize()InitializeStormLoggersystem by setting logging level resolved from system properties. To configure console logging level launch Storm withJVM_PROPERTYset to a custom logger level. -
get
public static org.apache.logging.log4j.Logger get()Returns an instance of Log4jLoggerused for logging. -
info
Logs a message object with theINFOlevel. -
info
Logs a formatted message withINFOlevel using the specified format string and arguments.- Parameters:
format- the formatString.params- arguments specified by the format.
-
detail
Logs a message object with theVERBOSElevel. -
detail
Logs a formatted message withVERBOSElevel using the specified format string and arguments.- Parameters:
format- the formatString.params- arguments specified by the format.
-
error
Logs a message object with theERRORlevel.- Parameters:
message- the message string to log.
-
error
Logs a formatted message withERRORlevel using the specified format string and arguments.- Parameters:
format- the formatString.params- arguments specified by the format.
-
error
- Parameters:
message- the message object to log.t- the exception to log, including its stack trace.
-
warn
Logs a message object with theWARNlevel.- Parameters:
message- the message string to log.
-
warn
Logs a formatted message withWARNlevel using the specified format string and arguments.- Parameters:
format- the formatString.params- arguments specified by the format.
-
debug
Logs a message object with theDEBUGlevel.- Parameters:
message- the message string to log.
-
debug
Logs a formatted message withDEBUGlevel using the specified format string and arguments.- Parameters:
format- the formatString.params- arguments specified by the format.
-
debug
- Parameters:
message- the message to log.t- the exception to log, including its stack trace.
-
printf
Logs a formatted message using the specified format string and arguments.- Parameters:
level- The logging Level.format- The format String.params- Arguments specified by the format.
-