- java.lang.Object
-
- org.datanucleus.util.NucleusLogger
-
- Direct Known Subclasses:
JDK14Logger,Log4J2Logger,Log4JLogger,NullLogger
public abstract class NucleusLogger extends Object
Logging framework for DataNucleus. Allows use of Log4J, JDK1.4, 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 NucleusLoggerCACHELog for Cache issuesstatic NucleusLoggerCONNECTIONLog for Connection issuesstatic NucleusLoggerDATASTORELog for Datastore issuesstatic NucleusLoggerDATASTORE_NATIVELog for Datastore native operationsstatic NucleusLoggerDATASTORE_PERSISTLog for Datastore persistence issuesstatic NucleusLoggerDATASTORE_RETRIEVELog for Datastore retrieval issuesstatic NucleusLoggerDATASTORE_SCHEMALog for Datastore Schema issuesstatic NucleusLoggerGENERALLog for General issuesstatic NucleusLoggerLIFECYCLELog for Lifecycle issuesstatic NucleusLoggerMETADATALog for METADATA issuesstatic NucleusLoggerPERSISTENCELog for Persistence issuesstatic NucleusLoggerQUERYLog for Query issuesstatic NucleusLoggerTRANSACTIONLog for Transaction issuesstatic NucleusLoggerVALUEGENERATIONLog 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 voiddebug(Object msg)Log a debug message.abstract voiddebug(Object msg, Throwable thr)Log a debug message with throwable.abstract voiderror(Object msg)Log an error message.abstract voiderror(Object msg, Throwable thr)Log an error message with throwable.abstract voidfatal(Object msg)Log a fatal message.abstract voidfatal(Object msg, Throwable thr)Log a fatal message with throwable.static NucleusLoggergetLoggerInstance(String logCategory)Method to create a logger instance.abstract ObjectgetNativeLogger()Accessor for the native logger object.abstract voidinfo(Object msg)Log an info message.abstract voidinfo(Object msg, Throwable thr)Log an info message with throwable.abstract booleanisDebugEnabled()Accessor for whether debug logging is enabledabstract booleanisInfoEnabled()Accessor for whether info logging is enabledabstract voidwarn(Object msg)Log a warning message.abstract voidwarn(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
-
LIFECYCLE
public static final NucleusLogger LIFECYCLE
Log for Lifecycle issues
-
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
-
-