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

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

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

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

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

The enabled option is used to enable smart logging.

dir

directory path same as the internal logging dir optional

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.