Package com.codingchili.core.logging
Class ConsoleLogger
java.lang.Object
java.util.logging.Handler
com.codingchili.core.logging.AbstractLogger
com.codingchili.core.logging.ConsoleLogger
- All Implemented Interfaces:
JsonLogger
,Logger
- Direct Known Subclasses:
LoggerMock
,StringLogger
Implementation of a console logger, filters some key/value combinations to better display the messages.
-
Field Summary
Fields inherited from class com.codingchili.core.logging.AbstractLogger
aClass, context, logger, metadata
-
Constructor Summary
ConstructorDescriptionSpecifies its own class name as the logging class.ConsoleLogger(CoreContext context, Class aClass)
ConsoleLogger(Class aClass)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Shuts down the logger instance, frees any resources such as files or thread pools.protected LogLevel
consumeLevel(io.vertx.core.json.JsonObject data)
log(io.vertx.core.json.JsonObject data)
protected String
parseJsonLog(io.vertx.core.json.JsonObject data, String event)
setEnabled(boolean enabled)
Methods inherited from class com.codingchili.core.logging.AbstractLogger
event, event, flush, log, log, onAlreadyInitialized, onCacheCleared, onConfigurationDefaultsLoaded, onError, onFileLoaded, onFileLoadError, onFileSaved, onFileSaveError, onHandlerMissing, onInvalidConfigurable, onListenerStarted, onListenerStopped, onMetricsSnapshot, onSecurityDependencyMissing, onServiceFailed, onServiceStarted, onServiceStopped, onTimerSourceChanged, publish, removeMetadata, setMetadata, setMetadataValue
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Constructor Details
-
ConsoleLogger
public ConsoleLogger()Specifies its own class name as the logging class. preferConsoleLogger(Class)
-
ConsoleLogger
- Parameters:
aClass
- the class that uses this logger.
-
ConsoleLogger
- Parameters:
context
- the context the logger is used on.aClass
- the class that uses this logger.
-
-
Method Details
-
close
Description copied from interface:Logger
Shuts down the logger instance, frees any resources such as files or thread pools.- Specified by:
close
in interfaceLogger
- Overrides:
close
in classAbstractLogger
- Throws:
SecurityException
-
setEnabled
- Parameters:
enabled
- disable/enable output of the logger.- Returns:
- fluent
-
getFilteredKeys
- Returns:
- a set of keys that will not be printed to the console.
-
log
- Specified by:
log
in interfaceJsonLogger
- Overrides:
log
in classAbstractLogger
- Parameters:
data
- the data to be logged.- Returns:
- fluent
-
parseJsonLog
-
consumeLevel
-
log
- Parameters:
line
- the text line to be logged.- Returns:
- fluent
-
log
- Parameters:
line
- the text line to be logged.level
- the logging level to log with.- Returns:
- fluent
-