Skip to content

feat: #104 add log format environment#105

Merged
KirillPamPam merged 2 commits intodrpcorg:mainfrom
sxwebdev:feat-add-log-format-environment
Feb 12, 2026
Merged

feat: #104 add log format environment#105
KirillPamPam merged 2 commits intodrpcorg:mainfrom
sxwebdev:feat-add-log-format-environment

Conversation

@sxwebdev
Copy link
Contributor

@sxwebdev sxwebdev commented Dec 19, 2025

Available to use custom logger format

  • LOG_FORMAT=console // by default
  • LOG_FORMAT=json

Console format (default):

2025-12-19T15:16:40+03:00 WRN internal/config/defaults.go:249 > no explicit rating function is specified, 'defaultLatencyPolicyFunc' will be used to calculate rating pid=32870
2025-12-19T15:16:40+03:00 INF cmd/nodecore/main.go:46 > the 'defaultLatencyPolicyFunc' default score function will be used to calculate rating pid=32870
2025-12-19T15:16:40+03:00 INF internal/upstreams/blocks/head.go:130 > starting an rpc head of upstream bsc-mainnet-2 with poll interval 1m0s pid=32870
2025-12-19T15:16:40+03:00 INF internal/upstreams/blocks/head.go:130 > starting an rpc head of upstream bsc-mainnet-1 with poll interval 1m0s pid=32870
2025-12-19T15:16:40+03:00 INF internal/upstreams/blocks/head.go:130 > starting an rpc head of upstream bsc-mainnet-3 with poll interval 1m0s pid=32870
2025-12-19T15:16:40+03:00 INF internal/upstreams/blocks/head.go:130 > starting an rpc head of upstream bsc-mainnet-4 with poll interval 1m0s pid=32870
2025-12-19T15:16:40+03:00 INF internal/rating/registry.go:76 > rating will be calculated every 10s pid=32870

JSON format:

{"level":"warn","time":"2025-12-19T15:28:13.084781+03:00","caller":"internal/config/defaults.go:236","message":"no explicit rating function is specified, 'defaultLatencyPolicyFunc' will be used to calculate rating"}
{"level":"info","time":"2025-12-19T15:28:13.089108+03:00","caller":"cmd/nodecore/main.go:46","message":"the 'defaultLatencyPolicyFunc' default score function will be used to calculate rating"}
{"level":"info","time":"2025-12-19T15:28:13.089328+03:00","caller":"internal/upstreams/blocks/head.go:130","message":"starting an rpc head of upstream bsc-mainnet-4 with poll interval 1m0s"}
{"level":"info","time":"2025-12-19T15:28:13.089344+03:00","caller":"internal/upstreams/blocks/head.go:130","message":"starting an rpc head of upstream bsc-mainnet-2 with poll interval 1m0s"}
{"level":"info","time":"2025-12-19T15:28:13.089334+03:00","caller":"internal/upstreams/blocks/head.go:130","message":"starting an rpc head of upstream bsc-mainnet-1 with poll interval 1m0s"}
{"level":"info","time":"2025-12-19T15:28:13.089344+03:00","caller":"internal/upstreams/blocks/head.go:130","message":"starting an rpc head of upstream bsc-mainnet-3 with poll interval 1m0s"}
{"level":"info","time":"2025-12-19T15:28:13.090022+03:00","caller":"internal/rating/registry.go:76","message":"rating will be calculated every 10s"}

@KirillPamPam KirillPamPam merged commit c72677e into drpcorg:main Feb 12, 2026
4 checks passed
@sxwebdev sxwebdev deleted the feat-add-log-format-environment branch March 13, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants