Skip to content

Logging

Under the logging config option the logging behavior and locations can be configured.

access

object recommended

Under the access option the http access log can be configured.

config.yaml
logging:
    access:
        dir: /var/log/lighthouse
        stderr: true

The following options are available:

dir

directory path optional LH_LOGGING_ACCESS_DIR

The dir option is used to configure the directory where the log file should be stored. If not set, LightHouse will not log to file.

stderr

boolean false optional LH_LOGGING_ACCESS_STDERR

The stderr option indicates if LightHouse logs to stderr.

internal

The internal option is used to configure logging for LightHouse's internal logging, i.e. logging related to what LightHouse does.

config.yaml
logging:
    internal:
        dir: /var/log/lighthouse
        stderr: true
        level: info
        smart:
            enabled: true
            dir: /var/log/lighthouse/errors

All configuration options from access also can be used with internal. In additional the following options can be used:

level

enum info optional LH_LOGGING_INTERNAL_LEVEL

The level option sets the minimal log level that should be logged.

Shortcut

You can also use LH_LOG_LEVEL as a shortcut for LH_LOGGING_INTERNAL_LEVEL.

Valid values are:

  • trace
  • debug
  • info
  • warn / warning
  • error
  • fatal
  • panic

smart

Under the smart option 'smart' logging can be enabled and configured. Smart logging allows to have a higher (less verbose) log level set for general (internal) logging without loosing valuable debug information in case errors occure.

If smart logging is enabled, the general logs are still done with the level set through the level option, but if an error occurs a special error log is created to a dedicated file. This dedicated error log contains all log entries - including all log levels, also levels that normally woud not be logged - for that particular request.

enabled

boolean false optional LH_LOGGING_INTERNAL_SMART_ENABLED

The enabled option is used to enable smart logging.

dir

directory path same as the internal logging dir optional LH_LOGGING_INTERNAL_SMART_DIR

The dir option is used to specify the directory where smart error log files should be stored. If not set and smart logging is enabled, smart error logs are placed in the same directory as the regular internal log file.

object optional

Under the banner option, startup banners can be enabled or disabled. The logo banner is an ANSI art; the version banner is rendered as an ASCII-art representation of the current Lighthouse version.

config.yaml
logging:
    banner:
        logo: false
        version: false

The following options are available:

boolean true optional LH_LOGGING_BANNER_LOGO

The logo option controls printing of the Lighthouse logo banner on startup.

version

boolean true optional LH_LOGGING_BANNER_VERSION

The version option controls printing of the version banner on startup.