Class GlassFishLogManagerInitializer

java.lang.Object
org.glassfish.main.jul.GlassFishLogManagerInitializer

public final class GlassFishLogManagerInitializer extends Object
This class tries to set the GlassFishLogManager as the default LogManager implementation.

The result is not guaranteed, because the first access to any Logger instance in the JVM starts the initialization.

Simply said - this must be the first thing application must execute.

Author:
David Matejcek
  • Method Details

    • tryToSetAsDefault

      public static boolean tryToSetAsDefault()
      Tries to set the GlassFishLogManageras the JVM's LogManager implementation. This must be done before any JUL component is used and remains set until JVM shutdown. The GlassFishLogManager will try to find the configuration automatically, use defaults, or will throw an exception, which depends on JVM options.
      Returns:
      true if the operation was successful
    • tryToSetAsDefault

      public static boolean tryToSetAsDefault(Properties configuration)
      Tries to set the GlassFishLogManageras the JVM's LogManager implementation. This must be done before any JUL component is used and remains set until JVM shutdown.
      Parameters:
      configuration - - logging.properties file content, if null, GlassFishLogManager will try to resolve it, the solution depends on JVM options.
      Returns:
      true if the operation was successful