Log.apex

  • Docs
  • Tutorials
Docs Menu
  • Logger
  • Configuration
    • Configuration File
    • Configure Logging
  • Appenders
    • Default Appenders
    • Custom Appenders
    • Async Logging
    • Default Async Appenders
    • Custom Async Appenders

Configuration File Guide

Configuration File

Configuration

A configuration file is a JSON file that contains an array of configuration rules.

[
    {
        ...
    },
    {
        ...
    }
]

Configuration Rule

A configuration rule specifies how the loggers should behave.

{
    "patterns": [ "test" ],
    "level": "Debug",
    "appenders": [
        {
            "name": "Log.DefaultAppender"
        }
    ]
}

It has following fields.

FieldDescription
patternsAn array of regular expressions to match the names of the loggers
levelThe starting level to enable logging
appendersAn array of appender configurations

Appender Configuration

An appender configuration is used to configure each appender, which outputs the logging information.

{
    "name": "Log.DefaultAppender",
    "options": {
        "prefixPattern": "..."
    }
}

It has following fields.

FieldDescription
nameThe class name of the appender
optionsThe JSON object(map) to hold the option values

Contribute on Github! Edit this section.