Class ExtendedLogger

java.lang.Object
java.util.logging.Logger
com.clumd.projects.java_custom_logging.logging.ExtendedLogger
Direct Known Subclasses:
ExtendedSlf4jLogger

public class ExtendedLogger extends Logger
This class is a very basic extension of the built-in JUL Logger, but with an expansive selection of 'log' methods for all the combinations of operations the average user might require.

There is also support for the 'tags' paradigm for log messages, explained as part of ExtendedLogRecord documentation. Other than the method signatures, basically the rest is a pass-through to the underling Logger, but using the aforementioned Extended Log Record in place of basic Log Record.

  • Constructor Details

    • ExtendedLogger

      protected ExtendedLogger(String name)
      Protected method to construct a logger for a named subsystem.

      The logger will be initially configured with a null Level and with useParentHandlers set to true.

      Parameters:
      name - A name for the logger. This should be a dot-separated name and should normally be based on the package name or class name of the subsystem, such as java.net or javax.swing. It may be null for anonymous Loggers.
      Throws:
      MissingResourceException - if the resourceBundleName is non-null and no corresponding resource can be found.
    • ExtendedLogger

      protected ExtendedLogger(String name, Set<String> bakedInTags)
      Protected method to construct a logger for a named subsystem.

      The logger will be initially configured with a null Level and with useParentHandlers set to true.

      Parameters:
      name - A name for the logger. This should be a dot-separated name and should normally be based on the package name or class name of the subsystem, such as java.net or javax.swing. It may be null for anonymous Loggers.
      bakedInTags - A collection of tags which should be applied to every single log message that this Logger will generate. This is mostly for uses such as distributed computing trace IDs or things such as concrete / unchanging environment variables.
  • Method Details