Class NucleusLogger
java.lang.Object
org.datanucleus.util.NucleusLogger
- Direct Known Subclasses:
JRELogger, Log4J2Logger, Log4JLogger, NullLogger
Logging framework for DataNucleus. Allows use of Log4J v2, Log4j v1, JRE, or no logging.
Performs a similar role to Apache CommonsLogging yet doesn't need an extra jar to be present in the CLASSPATH and also allows for no available logger.
Provides a series of predefined Loggers that can be used in the persistence process.
Also provides a method to create your own logger category.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NucleusLoggerLog for Cache issuesstatic final NucleusLoggerLog for Connection issuesstatic final NucleusLoggerLog for Datastore issuesstatic final NucleusLoggerLog for Datastore native operationsstatic final NucleusLoggerLog for Datastore persistence issuesstatic final NucleusLoggerLog for Datastore retrieval issuesstatic final NucleusLoggerLog for Datastore Schema issuesstatic final NucleusLoggerLog for General issuesprivate static ClassImplementation of NucleusLogger providing the logger.static final NucleusLoggerLog for METADATA issuesstatic final NucleusLoggerLog for Persistence issuesstatic final NucleusLoggerLog for Query issuesstatic final NucleusLoggerLog for Transaction issuesstatic final NucleusLoggerLog for value generation issues -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidLog a debug message.abstract voidLog a debug message with throwable.abstract voidLog an error message.abstract voidLog an error message with throwable.abstract voidLog a fatal message.abstract voidLog a fatal message with throwable.static NucleusLoggergetLoggerInstance(String logCategory) Method to create a logger instance.abstract ObjectAccessor for the native logger object.abstract voidLog an info message.abstract voidLog an info message with throwable.abstract booleanAccessor for whether debug logging is enabledabstract booleanAccessor for whether info logging is enabledabstract voidLog a warning message.abstract voidLog a warning message with throwable.
-
Field Details
-
LOGGER_CLASS
Implementation of NucleusLogger providing the logger. -
PERSISTENCE
Log for Persistence issues -
TRANSACTION
Log for Transaction issues -
CONNECTION
Log for Connection issues -
QUERY
Log for Query issues -
METADATA
Log for METADATA issues -
CACHE
Log for Cache issues -
DATASTORE
Log for Datastore issues -
DATASTORE_PERSIST
Log for Datastore persistence issues -
DATASTORE_RETRIEVE
Log for Datastore retrieval issues -
DATASTORE_SCHEMA
Log for Datastore Schema issues -
DATASTORE_NATIVE
Log for Datastore native operations -
GENERAL
Log for General issues -
VALUEGENERATION
Log for value generation issues
-
-
Constructor Details
-
NucleusLogger
public NucleusLogger()
-
-
Method Details
-
getLoggerInstance
Method to create a logger instance.- Parameters:
logCategory- The category (or null)- Returns:
- The logger
-
debug
-
debug
-
info
-
info
-
warn
-
warn
-
error
-
error
-
fatal
-
fatal
-
isDebugEnabled
public abstract boolean isDebugEnabled()Accessor for whether debug logging is enabled- Returns:
- Whether it is enabled
-
isInfoEnabled
public abstract boolean isInfoEnabled()Accessor for whether info logging is enabled- Returns:
- Whether it is enabled
-
getNativeLogger
Accessor for the native logger object.- Returns:
- The native logger object
-