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 Details

    • LOGGER_CLASS

      private static Class LOGGER_CLASS
      Implementation of NucleusLogger providing the logger.
    • 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
  • Constructor Details

    • NucleusLogger

      public NucleusLogger()
  • Method Details

    • 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 message
      thr - 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 message
      thr - 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 message
      thr - 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 message
      thr - 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 message
      thr - 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