Class AbstractLoggerAbstract

The LogMethods interface provides all methods handling the creation of log messages. In order to provide the additional log message information, the abstract methods should be implemented by subclasses.

Hierarchy (view full)

Constructors

Methods

  • Determines the log message origin based on the origin configured and the globally set origin. If the origins of this logger and the root are set and differ, they will be concatenated using a slash ('/).

    Parameters

    • Optional explicitOrigin: null | string

      The origin configured in this logger is extensible by an explicit string specified.

    Returns null | string

  • Needs to be implemented by subclasses in order to provide the category of this logger.

    Returns null | string | Category

  • Parameters

    Returns null | string

  • If the implementor of this interface provides a category, the category string will be determined in form of a string with the syntax 'Category.Subcategory.*'. If the category specified in this object starts with a period ('.'), it is appended to this and/or a parent logger's category.

    Parameters

    • Optional explicitCategory: null | string | Category

      The category specified to this object can be overridden by providing an absolute category string (not starting with period) or a category object.

    Returns null | string

  • Needs to be implemented by subclasses in order to provide the id of this logger.

    Returns null | string

  • Needs to be implemented by subclasses in order to provide the origin of this logger.

    Returns null | string

  • Needs to be implemented by subclasses in order to provide the parent log entity providing the parent ref fragment, category, and origin for the propagation to log messages.

    Returns null | AbstractLogger

  • Needs to be implemented by subclasses in order to provide the ref fragment of this logger.

    Returns null | string

  • The implementor of this interface provides a ref fragment, else, a parent's ref will be used. If it also provides a parent logger entity, its ref fragment will be prepended to this ref fragment so that the resulting ref string has the syntax 'Module:SubModule:*:Class:Function' of which every element is optional.

    Parameters

    • Optional subRef: null | string

      If specified, this ref will be appended to the logger's basic ref.

    Returns string

  • Adds a new appender to the logger's local appenders list. This can be used for handling logger-specific appenders.

    Parameters

    Returns AbstractLogger

    enables chaining calls to the logger

  • Sets a category for the next log message. The respective log method must be called on the returned object (method chaining). The returned object allows to call more parameter specifying methods. If the returned object is withdrawn, the set category information is lost. The category of the new log message defaults to the logger's category.

    Parameters

    • category: string | Category

      The category to set for the next log message. If a Category object or a string is provided, it will be used as the actual category of the message. If a string is provided that starts with a period, e.g. '.subcategory', it will be used as a sub category of the parent logger's category. The categories will then be concatenated separated by a perios ('.').

    Returns ILogger

    The log message builder object that allows to specify more parameters of the next log message.

  • For debugging purposes.

    Parameters

    • message: string

      The actual log message.

    • Optional parameters: null | object

      The log message parameters. Its keys will replace the '%key%' placeholders in the message string.

    Returns ILogger

  • Errors due to malconfiguration of the software.

    Parameters

    • message: string

      The actual log message.

    • Optional parameters: null | object

      The log message parameters. Its keys will replace the '%key%' placeholders in the message string.

    Returns ILogger

  • Sets the next log message to be appended to the fallback appender. The respective log method must be called on the returned object (method chaining). If the returned object is withdrawn, the set fallback information is lost. This disables the evaluation of message filters to the appenders. The log framework does this internally, if errors in custom code or appenders occur.

    Parameters

    • Optional fallBack: boolean

      If true, the next message will be handled by a fallback appender.

    Returns ILogger

    The returned object allows to call more parameter specifying methods.

  • Unintended behaviour of the software, e.g. unhandled exceptions.

    Parameters

    • message: string

      The actual log message.

    • Optional parameters: null | object

      The log message parameters. Its keys will replace the '%key%' placeholders in the message string.

    Returns ILogger

  • Sets the id for the next log message. The respective log method must be called on the returned object (method chaining). The returned object allows to call more parameter specifying methods. If the returned object is withdrawn, the set id information is lost.

    Parameters

    • id: string

      The id to set for the next log message

    Returns ILogger

    The log message builder object that allows to specify more parameters of the next log message.

  • Information about the actions that are executed by the software. For User feedback.

    Parameters

    • message: string

      The actual log message.

    • Optional parameters: null | object

      The log message parameters. Its keys will replace the '%key%' placeholders in the message string.

    Returns ILogger

  • Creates a new LogMessage by calling the abstract methods in this interface.

    Parameters

    • severity: Severity

      The severity of the log message. Possible values are specified by the LogMessage.Severity Enum.

    • message: string

      The actual log message.

    • Optional parameters: null | object

      The log message parameters. Its keys will replace the '%key%' placeholders in the message string.

    Returns ILogger

  • Sets the onceId for the new log message. The respective log method must be called on the returned object (method chaining). If the returned object is withdrawn, the set fallback information is lost. If set, other messages using the same onceid will not be handled.

    Parameters

    • Optional onceId: string | boolean

      if set to true, only, the combination of loglevel, id or message text will be used for identifying similar messages

    Returns ILogger

  • Sets the origin (current environment) for the next log message. The respective log method must be called on the returned object (method chaining). The returned object allows to call more parameter specifying methods. If the returned object is withdrawn, the set origin information is lost. The origin of the new log message defaults to the logger's origin. If providing an origin that differs from the logger's origin, the strings are concatenated separated by a slash ('/')

    Parameters

    • origin: string

      The origin to set for the next log message

    Returns ILogger

    The log message builder object that allows to specify more parameters of the next log message.

  • Sets a ref fragment for the next log message. The respective log method must be called on the returned object (method chaining). The returned object allows to call more parameter specifying methods. If the returned object is withdrawn, the set ref fragment information is lost. The ref fragment of the new log message defaults to the logger's ref fragment. All fragments in the chain of loggers are concatenated separated by a colon (':')

    Parameters

    • ref: string

      The ref fragment to set for the next log message

    Returns ILogger

    The log message builder object that allows to specify more parameters of the next log message.

  • Creates a new logger instance as a child of this logger.

    Parameters

    • ref: string

      The ref fragment of the source code organization unit (e.g. module, class, function) that requests the new logger.

    • Optional category: null | string | Category

      The (new sub-/root-) category of the new logger.

    • Optional origin: null | string

      The origin of the new logger.

    Returns AbstractLogger

  • The most verbose output level.

    Parameters

    • message: string

      The actual log message.

    • Optional parameters: null | object

      The log message parameters. Its keys will replace the '%key%' placeholders in the message string.

    Returns ILogger

  • Warnings about unintended behaviour or usage of the software or possible security and safety risks.

    Parameters

    • message: string

      The actual log message.

    • Optional parameters: null | object

      The log message parameters. Its keys will replace the '%key%' placeholders in the message string.

    Returns ILogger