Package org.datanucleus.util
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 NucleusLogger
Log for Cache issuesstatic final NucleusLogger
Log for Connection issuesstatic final NucleusLogger
Log for Datastore issuesstatic final NucleusLogger
Log for Datastore native operationsstatic final NucleusLogger
Log for Datastore persistence issuesstatic final NucleusLogger
Log for Datastore retrieval issuesstatic final NucleusLogger
Log for Datastore Schema issuesstatic final NucleusLogger
Log for General issuesprivate static Class
Implementation of NucleusLogger providing the logger.static final NucleusLogger
Log for METADATA issuesstatic final NucleusLogger
Log for Persistence issuesstatic final NucleusLogger
Log for Query issuesstatic final NucleusLogger
Log for Transaction issuesstatic final NucleusLogger
Log for value generation issues -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Log a debug message.abstract void
Log a debug message with throwable.abstract void
Log an error message.abstract void
Log an error message with throwable.abstract void
Log a fatal message.abstract void
Log a fatal message with throwable.static NucleusLogger
getLoggerInstance
(String logCategory) Method to create a logger instance.abstract Object
Accessor for the native logger object.abstract void
Log an info message.abstract void
Log an info message with throwable.abstract boolean
Accessor for whether debug logging is enabledabstract boolean
Accessor for whether info logging is enabledabstract void
Log a warning message.abstract void
Log 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
Log a debug message.- Parameters:
msg
- The message
-
debug
Log a debug message with throwable.- Parameters:
msg
- The messagethr
- A throwable
-
info
Log an info message.- Parameters:
msg
- The message
-
info
Log an info message with throwable.- Parameters:
msg
- The messagethr
- A throwable
-
warn
Log a warning message.- Parameters:
msg
- The message
-
warn
Log a warning message with throwable.- Parameters:
msg
- The messagethr
- A throwable
-
error
Log an error message.- Parameters:
msg
- The message
-
error
Log an error message with throwable.- Parameters:
msg
- The messagethr
- A throwable
-
fatal
Log a fatal message.- Parameters:
msg
- The message
-
fatal
Log a fatal message with throwable.- Parameters:
msg
- The messagethr
- A throwable
-
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
-