We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e10c578 commit 4e5afabCopy full SHA for 4e5afab
Makefile
@@ -166,14 +166,26 @@ test-iex:
166
checkpoint-sync: compile-all
167
iex -S mix run -- --checkpoint-sync-url https://mainnet-checkpoint-sync.stakely.io/ --metrics
168
169
+#▶️ checkpoint-sync.logfile: @ Run an interactive terminal using checkpoint sync with a log file.
170
+checkpoint-sync.logfile: compile-all
171
+ iex -S mix run -- --checkpoint-sync-url https://mainnet-checkpoint-sync.stakely.io/ --metrics --log-file ./logs/mainnet.log
172
+
173
#▶️ sepolia: @ Run an interactive terminal using sepolia network
174
sepolia: compile-all
175
iex -S mix run -- --checkpoint-sync-url https://sepolia.beaconstate.info --network sepolia --metrics
176
177
+#▶️ sepolia.logfile: @ Run an interactive terminal using sepolia network with a log file
178
+sepolia.logfile: compile-all
179
+ iex -S mix run -- --checkpoint-sync-url https://sepolia.beaconstate.info --network sepolia --metrics --log-file ./logs/sepolia.log
180
181
#▶️ holesky: @ Run an interactive terminal using holesky network
182
holesky: compile-all
183
iex -S mix run -- --checkpoint-sync-url https://checkpoint-sync.holesky.ethpandaops.io --network holesky
184
185
+#▶️ holesky.logfile: @ Run an interactive terminal using holesky network with a log file
186
+holesky.logfile: compile-all
187
+ iex -S mix run -- --checkpoint-sync-url https://checkpoint-sync.holesky.ethpandaops.io --network holesky --log-file ./logs/holesky.log
188
189
#▶️ gnosis: @ Run an interactive terminal using gnosis network
190
gnosis: compile-all
191
iex -S mix run -- --checkpoint-sync-url https://checkpoint.gnosischain.com --network gnosis
config/runtime.exs
@@ -219,7 +219,7 @@ case Keyword.get(args, :log_file) do
219
nil ->
220
# Use custom formatter for prettier logs
221
config :logger, :default_formatter,
222
- format: {ConsoleLogger, :format},
+ format: {CustomConsoleLogger, :format},
223
metadata: [:slot, :root, :bits]
224
225
log_file ->
@@ -241,9 +241,9 @@ case Keyword.get(args, :log_file) do
241
config :logger, utc_log: true
242
243
244
- format: {LogfmtEx, :format},
+ format: {CustomLogfmtEx, :format},
245
colors: [enabled: false],
246
- metadata: [:mfa, :slot]
+ metadata: [:mfa, :pid, :slot, :root]
247
248
config :logfmt_ex, :opts,
249
message_key: "msg",
lib/lambda_ethereum_consensus/logger/console_logger.ex renamed to lib/lambda_ethereum_consensus/logger/custom_console_logger.ex
@@ -1,4 +1,4 @@
1
-defmodule ConsoleLogger do
+defmodule CustomConsoleLogger do
2
@moduledoc """
3
Custom logger formatter for console output.
4
"""
lib/lambda_ethereum_consensus/logger/custom_logfmt_ex.ex
@@ -0,0 +1,19 @@
+defmodule CustomLogfmtEx do
+ @moduledoc """
+ Custom logger formatter for logfmt output.
+ """
5
6
+ alias LambdaEthereumConsensus.Utils
7
8
+ def format(level, message, timestamp, metadata) do
9
+ formatted_metadata = format_metadata(metadata)
10
11
+ LogfmtEx.format(level, message, timestamp, formatted_metadata)
12
+ end
13
14
+ defp format_metadata(metadata) do
15
+ metadata
16
+ |> Keyword.replace_lazy(:root, &Utils.format_shorten_binary(&1))
17
+ |> Keyword.replace_lazy(:bits, &Utils.format_bitstring(&1))
18
19
+end
metrics/loki/loki.yml
@@ -34,7 +34,7 @@ schema_config:
34
period: 24h
35
36
ruler:
37
- alertmanager_url: http://localhost:9093
+ alertmanager_url: http://localhost:9093/alertmanager
38
# By default, Loki will send anonymous, but uniquely-identifiable usage and configuration
39
# analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/
40
#
metrics/promtail/promtail.yml
@@ -24,12 +24,18 @@ scrape_configs:
24
msg:
25
mfa:
26
process: registered_name
27
+ pid:
28
+ slot:
29
+ root:
30
- timestamp:
31
format: "2006-01-02T15:04:05.000"
32
source: ts
33
- labels:
level:
process:
- output:
41
source: msg
0 commit comments