org.apache.uima.util.impl

## Class Log4jLogger_impl

- java.lang.Object
- - org.apache.uima.util.impl.Log4jLogger_impl

- All Implemented Interfaces:
    Logger

      public class Log4jLogger_impl
      extends Object
      implements Logger

  UIMA Logging interface implementation for Log4j

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Logger` | `getInstance()` Creates a new Log4jLogger instance with the default Log4j framework logger
    `static Logger` | `getInstance(Class<?> component)` Creates a new Log4jLogger instance for the specified source class
    `boolean` | `isLoggable(Level level)` Checks if the argument level is greater or equal to the specified level
    `void` | `log(Level level, String aMessage)` Logs a message.
    `void` | `log(Level level, String aMessage, Object param1)` Logs a message with one parameter
    `void` | `log(Level level, String aMessage, Object[] params)` Logs a message with an arbitrary number of parameters
    `void` | `log(Level level, String aMessage, Throwable thrown)` Logs a message and a throwable object
    `void` | `log(String aMessage)` Deprecated. use new function with log level
    `void` | `log(String wrapperFQCN, Level level, String message, Throwable thrown)` Generic logging method intended for logging wrappers.
    `void` | `log(String aResourceBundleName, String aMessageKey, Object[] aArguments)` Deprecated. use new function with log level
    `void` | `logException(Exception aException)` Deprecated. use new function with log level
    `void` | `logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey)` Logs a message with a message key.
    `void` | `logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object param1)` Logs a message with a message key and one parameter.
    `void` | `logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Object[] params)` Logs a message with a message key and an arbitrary number of parameters.
    `void` | `logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msgKey, Throwable thrown)` Logs a message with a message key and a throwable object.
    `void` | `setLevel(Level level)` Sets the level of messages that will be logged by this logger.
    `void` | `setOutputStream(OutputStream out)` Deprecated. use external configuration possibility
    `void` | `setOutputStream(PrintStream out)` Deprecated. use external configuration possibility
    `void` | `setResourceManager(ResourceManager resourceManager)` Sets the ResourceManager to use for message localization.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInstance

          public static Logger getInstance(Class<?> component)

      Creates a new Log4jLogger instance for the specified source class
      Parameters:
        `component` - current source class
      Returns:
        Logger returns the JSR47Logger object for the specified class

    - #### getInstance

          public static Logger getInstance()

      Creates a new Log4jLogger instance with the default Log4j framework logger
      Returns:
        Logger returns the JSR47Logger object with the default Log4j framework logger

    - #### log

          @Deprecated
          public void log(String aMessage)

      Deprecated. use new function with log level
      Logs a message with level INFO.
      Specified by:
        `log` in interface `Logger`
      Parameters:
        `aMessage` - the message to be logged

    - #### log

          @Deprecated
          public void log(String aResourceBundleName,
                                      String aMessageKey,
                                      Object[] aArguments)

      Deprecated. use new function with log level
      Logs a message with a message key and the level INFO
      Specified by:
        `log` in interface `Logger`
      Parameters:
        `aResourceBundleName` - base name of resource bundle
        `aMessageKey` - key of message to localize with message level INFO
        `aArguments` - arguments to message (may be null if none)
      See Also:
        `Logger.log(java.lang.String, java.lang.String, java.lang.Object[])`

    - #### logException

          @Deprecated
          public void logException(Exception aException)

      Deprecated. use new function with log level
      Logs an exception with level INFO
      Specified by:
        `logException` in interface `Logger`
      Parameters:
        `aException` - the exception to be logged

    - #### setOutputStream

          @Deprecated
          public void setOutputStream(OutputStream out)

      Deprecated. use external configuration possibility
      Description copied from interface: `Logger`
      Sets the output stream to which log messages will go. Setting the output stream to `null` will disable the logger.
      Specified by:
        `setOutputStream` in interface `Logger`
      Parameters:
        `out` - `OutputStream` to which log messages will be printed
      See Also:
        `Logger.setOutputStream(java.io.OutputStream)`

    - #### setOutputStream

          @Deprecated
          public void setOutputStream(PrintStream out)

      Deprecated. use external configuration possibility
      Description copied from interface: `Logger`
      Sets the output stream to which log messages will go. Setting the output stream to `null` will disable the logger.
      Specified by:
        `setOutputStream` in interface `Logger`
      Parameters:
        `out` - `PrintStream` to which log messages will be printed
      See Also:
        `Logger.setOutputStream(java.io.PrintStream)`

    - #### isLoggable

          public boolean isLoggable(Level level)

      Description copied from interface: `Logger`
      Checks if the argument level is greater or equal to the specified level
      Specified by:
        `isLoggable` in interface `Logger`
      Parameters:
        `level` - message level
      Returns:
        boolean - true if the argument level is greater or equal to the specified level

    - #### setLevel

          public void setLevel(Level level)

      Description copied from interface: `Logger`
      Sets the level of messages that will be logged by this logger. Note that if you call `UIMAFramework.getLogger().setLevel(level)`, this will only change the logging level for messages produced by the UIMA framework. It will NOT change the logging level for messages produced by annotators. To change the logging level for an annotator, use `UIMAFramework.getLogger(YourAnnotatorClass.class).setLevel(level)`.

      If you need more flexibility it configuring the logger, consider using the standard Java logger properties file or the java.util.logging APIs.

      Specified by:
        `setLevel` in interface `Logger`
      Parameters:
        `level` - message level

    - #### log

          public void log(Level level,
                          String aMessage)

      Description copied from interface: `Logger`
      Logs a message.
      Specified by:
        `log` in interface `Logger`
      Parameters:
        `level` - message level
        `aMessage` - the message to be logged

    - #### log

          public void log(Level level,
                          String aMessage,
                          Object param1)

      Description copied from interface: `Logger`
      Logs a message with one parameter
      Specified by:
        `log` in interface `Logger`
      Parameters:
        `level` - message level
        `aMessage` - the message to be logged
        `param1` - message parameter

    - #### log

          public void log(Level level,
                          String aMessage,
                          Object[] params)

      Description copied from interface: `Logger`
      Logs a message with an arbitrary number of parameters
      Specified by:
        `log` in interface `Logger`
      Parameters:
        `level` - message level
        `aMessage` - the message to be logged
        `params` - message parameter array

    - #### log

          public void log(Level level,
                          String aMessage,
                          Throwable thrown)

      Description copied from interface: `Logger`
      Logs a message and a throwable object
      Specified by:
        `log` in interface `Logger`
      Parameters:
        `level` - message level
        `aMessage` - the message to be logged
        `thrown` - throwable object

    - #### logrb

          public void logrb(Level level,
                            String sourceClass,
                            String sourceMethod,
                            String bundleName,
                            String msgKey,
                            Object param1)

      Description copied from interface: `Logger`
      Logs a message with a message key and one parameter. The real message is extracted from a resource bundle.
      Specified by:
        `logrb` in interface `Logger`
      Parameters:
        `level` - message level
        `sourceClass` - source class name
        `sourceMethod` - source method name
        `bundleName` - resource bundle
        `msgKey` - message key
        `param1` - message parameter

    - #### logrb

          public void logrb(Level level,
                            String sourceClass,
                            String sourceMethod,
                            String bundleName,
                            String msgKey,
                            Object[] params)

      Description copied from interface: `Logger`
      Logs a message with a message key and an arbitrary number of parameters. The real message is extracted from a resource bundle.
      Specified by:
        `logrb` in interface `Logger`
      Parameters:
        `level` - message level
        `sourceClass` - source class name
        `sourceMethod` - source method name
        `bundleName` - resource bundle
        `msgKey` - message key
        `params` - message parameter array with an arbitrary number of parameters

    - #### logrb

          public void logrb(Level level,
                            String sourceClass,
                            String sourceMethod,
                            String bundleName,
                            String msgKey,
                            Throwable thrown)

      Description copied from interface: `Logger`
      Logs a message with a message key and a throwable object. The real message is extracted from a resource bundle.
      Specified by:
        `logrb` in interface `Logger`
      Parameters:
        `level` - message level
        `sourceClass` - source class name
        `sourceMethod` - source method name
        `bundleName` - resource bundle
        `msgKey` - message key
        `thrown` - throwable object

    - #### logrb

          public void logrb(Level level,
                            String sourceClass,
                            String sourceMethod,
                            String bundleName,
                            String msgKey)

      Description copied from interface: `Logger`
      Logs a message with a message key. The real message is extracted from a resource bundle.
      Specified by:
        `logrb` in interface `Logger`
      Parameters:
        `level` - message level
        `sourceClass` - source class name
        `sourceMethod` - source method name
        `bundleName` - resource bundle
        `msgKey` - message key

    - #### log

          public void log(String wrapperFQCN,
                          Level level,
                          String message,
                          Throwable thrown)

      Description copied from interface: `Logger`
      Generic logging method intended for logging wrappers.
      Specified by:
        `log` in interface `Logger`
      Parameters:
        `wrapperFQCN` - fully qualified class name of the wrapper
        `level` - message level
        `message` - message
        `thrown` - throwable object

    - #### setResourceManager

          public void setResourceManager(ResourceManager resourceManager)

      Description copied from interface: `Logger`
      Sets the ResourceManager to use for message localization. This method is intended for use by the framework, not by user code.
      Specified by:
        `setResourceManager` in interface `Logger`
      Parameters:
        `resourceManager` - A resource manager instance whose extension ClassLoader (if any) will be used for message localization by this logger.

Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.