Class OneLineFormatter


public class OneLineFormatter extends GlassFishLogFormatter
Fast Formatter usable in tests or even in production if you need only simple logs with time, level and messages.

Note that if you configured the formatter from your code (and not a property file), if you want to source class and method automatically detected, you have to enable GlassFishLoggingConstants.KEY_CLASS_AND_METHOD_DETECTION_ENABLED. Without that the output will contain just class and method fields manually set to the LogRecord or using Logger methods which have these parameters to do that.

Author:
David Matejcek
  • Constructor Details

    • OneLineFormatter

      public OneLineFormatter(HandlerId handlerId)
      Creates formatter with default time format if not set otherwise in the logging configuration.
      Parameters:
      handlerId -
    • OneLineFormatter

      public OneLineFormatter()
      Creates an instance and initializes defaults from log manager's configuration
  • Method Details