Class LoggingConfig

java.lang.Object
com.cedarsoftware.util.LoggingConfig

public final class LoggingConfig extends Object
Configures java.util.logging to use a uniform log format similar to popular frameworks like SLF4J/Logback.
  • Method Details

    • init

      public static void init()
      Initialize logging if not already configured. The formatter pattern can be set via system property "ju.log.dateFormat" or by calling init(String). If running in test environment (detected by system property), uses clean test format.
    • initForTests

      public static void initForTests()
      Initialize logging with simple format for tests (no timestamps, no thread names). Use this in test environments to get clean output similar to Maven's format. This method will force the test formatter even if logging was already initialized.
    • init

      public static void init(String datePattern)
      Initialize logging with the supplied date pattern if not already configured.
      Parameters:
      datePattern - pattern passed to SafeSimpleDateFormat
    • useUniformFormatter

      public static void useUniformFormatter(Handler handler)
      Set the LoggingConfig.UniformFormatter on the supplied handler.
      Parameters:
      handler - the handler to configure