Package org.datanucleus.util
Class NucleusLogger
- java.lang.Object
-
- org.datanucleus.util.NucleusLogger
-
- Direct Known Subclasses:
JRELogger
,Log4J2Logger
,Log4JLogger
,NullLogger
public abstract class NucleusLogger extends Object
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
Fields Modifier and Type Field Description static NucleusLogger
CACHE
Log for Cache issuesstatic NucleusLogger
CONNECTION
Log for Connection issuesstatic NucleusLogger
DATASTORE
Log for Datastore issuesstatic NucleusLogger
DATASTORE_NATIVE
Log for Datastore native operationsstatic NucleusLogger
DATASTORE_PERSIST
Log for Datastore persistence issuesstatic NucleusLogger
DATASTORE_RETRIEVE
Log for Datastore retrieval issuesstatic NucleusLogger
DATASTORE_SCHEMA
Log for Datastore Schema issuesstatic NucleusLogger
GENERAL
Log for General issuesstatic NucleusLogger
METADATA
Log for METADATA issuesstatic NucleusLogger
PERSISTENCE
Log for Persistence issuesstatic NucleusLogger
QUERY
Log for Query issuesstatic NucleusLogger
TRANSACTION
Log for Transaction issuesstatic NucleusLogger
VALUEGENERATION
Log for value generation issues
-
Constructor Summary
Constructors Constructor Description NucleusLogger()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
debug(Object msg)
Log a debug message.abstract void
debug(Object msg, Throwable thr)
Log a debug message with throwable.abstract void
error(Object msg)
Log an error message.abstract void
error(Object msg, Throwable thr)
Log an error message with throwable.abstract void
fatal(Object msg)
Log a fatal message.abstract void
fatal(Object msg, Throwable thr)
Log a fatal message with throwable.static NucleusLogger
getLoggerInstance(String logCategory)
Method to create a logger instance.abstract Object
getNativeLogger()
Accessor for the native logger object.abstract void
info(Object msg)
Log an info message.abstract void
info(Object msg, Throwable thr)
Log an info message with throwable.abstract boolean
isDebugEnabled()
Accessor for whether debug logging is enabledabstract boolean
isInfoEnabled()
Accessor for whether info logging is enabledabstract void
warn(Object msg)
Log a warning message.abstract void
warn(Object msg, Throwable thr)
Log a warning message with throwable.
-
-
-
Field Detail
-
PERSISTENCE
public static final NucleusLogger PERSISTENCE
Log for Persistence issues
-
TRANSACTION
public static final NucleusLogger TRANSACTION
Log for Transaction issues
-
CONNECTION
public static final NucleusLogger CONNECTION
Log for Connection issues
-
QUERY
public static final NucleusLogger QUERY
Log for Query issues
-
METADATA
public static final NucleusLogger METADATA
Log for METADATA issues
-
CACHE
public static final NucleusLogger CACHE
Log for Cache issues
-
DATASTORE
public static final NucleusLogger DATASTORE
Log for Datastore issues
-
DATASTORE_PERSIST
public static final NucleusLogger DATASTORE_PERSIST
Log for Datastore persistence issues
-
DATASTORE_RETRIEVE
public static final NucleusLogger DATASTORE_RETRIEVE
Log for Datastore retrieval issues
-
DATASTORE_SCHEMA
public static final NucleusLogger DATASTORE_SCHEMA
Log for Datastore Schema issues
-
DATASTORE_NATIVE
public static final NucleusLogger DATASTORE_NATIVE
Log for Datastore native operations
-
GENERAL
public static final NucleusLogger GENERAL
Log for General issues
-
VALUEGENERATION
public static final NucleusLogger VALUEGENERATION
Log for value generation issues
-
-
Method Detail
-
getLoggerInstance
public static NucleusLogger getLoggerInstance(String logCategory)
Method to create a logger instance.- Parameters:
logCategory
- The category (or null)- Returns:
- The logger
-
debug
public abstract void debug(Object msg)
Log a debug message.- Parameters:
msg
- The message
-
debug
public abstract void debug(Object msg, Throwable thr)
Log a debug message with throwable.- Parameters:
msg
- The messagethr
- A throwable
-
info
public abstract void info(Object msg)
Log an info message.- Parameters:
msg
- The message
-
info
public abstract void info(Object msg, Throwable thr)
Log an info message with throwable.- Parameters:
msg
- The messagethr
- A throwable
-
warn
public abstract void warn(Object msg)
Log a warning message.- Parameters:
msg
- The message
-
warn
public abstract void warn(Object msg, Throwable thr)
Log a warning message with throwable.- Parameters:
msg
- The messagethr
- A throwable
-
error
public abstract void error(Object msg)
Log an error message.- Parameters:
msg
- The message
-
error
public abstract void error(Object msg, Throwable thr)
Log an error message with throwable.- Parameters:
msg
- The messagethr
- A throwable
-
fatal
public abstract void fatal(Object msg)
Log a fatal message.- Parameters:
msg
- The message
-
fatal
public abstract void fatal(Object msg, Throwable thr)
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
public abstract Object getNativeLogger()
Accessor for the native logger object.- Returns:
- The native logger object
-
-