@ -31,6 +31,11 @@ config :logger, :empty_blocks_to_refetch,
path: Path.absname("logs/dev/indexer/empty_blocks_to_refetch.log"),
metadata_filter: [fetcher: :empty_blocks_to_refetch]
config :logger, :block_import_timings,
level: :debug,
path: Path.absname("logs/dev/indexer/block_import_timings.log"),
metadata_filter: [fetcher: :block_import_timings]
variant =
if is_nil(System.get_env("ETHEREUM_JSONRPC_VARIANT")) do
"ganache"
@ -37,6 +37,11 @@ config :logger, :empty_blocks_to_refetch,
metadata_filter: [fetcher: :empty_blocks_to_refetch],
rotate: %{max_bytes: 52_428_800, keep: 19}
path: Path.absname("logs/prod/indexer/block_import_timings.log"),
"parity"
@ -364,7 +364,9 @@ defmodule Indexer.Block.Realtime.Fetcher do
defp log_import_timings(%{blocks: [%{number: number, timestamp: timestamp}]}, fetch_duration, time_before) do
node_delay = Timex.diff(time_before, timestamp, :seconds)
Logger.info("Block #{number} fetching duration: #{fetch_duration / 1_000_000}s. Node delay: #{node_delay}s.")
Logger.debug("Block #{number} fetching duration: #{fetch_duration / 1_000_000}s. Node delay: #{node_delay}s.",
fetcher: :block_import_timings
)
end
defp log_import_timings(_inserted, _duration, _time_before), do: nil
@ -34,7 +34,8 @@ config :logger,
{LoggerFileBackend, :reading_token_functions},
{LoggerFileBackend, :pending_transactions_to_refetch},
{LoggerFileBackend, :empty_blocks_to_refetch},
{LoggerFileBackend, :api}
{LoggerFileBackend, :api},
{LoggerFileBackend, :block_import_timings}
]
config :logger, :console,