Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 1.52 KB

logger-configs.md

File metadata and controls

36 lines (24 loc) · 1.52 KB
description
Adjust # of files and max size to impact disc space

Logger Configs

Each umbrella app (indexer, explorer, block_scout_web, ethereum_json_rpc) contains a log rotation config in the prod.exs file.

{% hint style="info" %} Example: https://github.com/blockscout/blockscout/blob/master/apps/explorer/config/prod.exs#L36-L51__ {% endhint %}

config :logger, :explorer,
  level: :info,
  path: Path.absname("logs/prod/explorer.log"),
  rotate: %{max_bytes: 52_428_800, keep: 19}

config :logger, :reading_token_functions,
  level: :debug,
  path: Path.absname("logs/prod/explorer/tokens/reading_functions.log"),
  metadata_filter: [fetcher: :token_functions],
  rotate: %{max_bytes: 52_428_800, keep: 19}

config :logger defines several variables including:

  • level: (info, debug, error) log level of detail
  • rotate: {max bytes: 52,428,800 max size in bytes for each file, keep: 19 max number of files to store}

If you are having issues with disc space, change the level, default number of files, and max bytes to consume less space with logs.

Additional log rotation configs for ecto.log (DB interactions wrapper) and error.log are located in the common config file https://github.com/blockscout/blockscout/blob/master/config/config.exs#L47-L61