8000 Add support for json logging. by joel-u410 · Pull Request #138 · Zondax/namadexer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

Add support for json logging. #138

Merged
merged 1 commit into from
Feb 19, 2024
Merged

Add support for json logging. #138

merged 1 commit into from
Feb 19, 2024

Conversation

joel-u410
Copy link
Contributor

This introduces a new optional config option log_format which can be either "pretty" (the default) or "json".

When using log_format = "json" the logs will look like this:

{"timestamp":"2024-02-15T23:55:08.209893Z","level":"INFO","fields":{"message":"Starting database connection"},"target":"indexer"}
{"timestamp":"2024-02-15T23:55:08.307973Z","level":"INFO","fields":{"message":"Creating tables"},"target":"indexer"}
{"timestamp":"2024-02-15T23:55:08.308131Z","level":"INFO","fields":{"message":"Creating tables if they don't exist"},"target":"namadexer::database","span":{"name":"create_tables"},"spans":[{"name":"create_tables"}]}
{"timestamp":"2024-02-15T23:55:08.413702Z","level":"INFO","fields":{"message":"Starting indexer"},"target":"indexer"}
{"timestamp":"2024-02-15T23:55:08.413765Z","level":"INFO","fields":{"message":"***** Starting indexer *****"},"target":"namadexer::indexer"}
{"timestamp":"2024-02-15T23:55:08.418843Z","level":"INFO","fields":{"message":"Starting at height : 23688"},"target":"namadexer::indexer"}
{"timestamp":"2024-02-15T23:55:08.422336Z","level":"INFO","fields":{"message":"We already have indexes created resuming from last block indexed"},"target":"namadexer::indexer::utils","span":{"name":"Utils::has_indexes"},"spans":[{"name":"Utils::has_indexes"}]}

@ainhoa-a ainhoa-a requested a review from rllola February 18, 2024 21:43
rllola < 8C23 div aria-label="Only reviews by reviewers with write access count toward mergeability" aria-role="image" data-view-component="true" class="TimelineItem-badge">
@rllola rllola merged commit 7d52663 into Zondax:main Feb 19, 2024
HadesGuard pushed a commit to HadesGuard/namadexer that referenced this pull request Feb 23, 2024
This introduces a new _optional_ config option `log_format` which can be
either `"pretty"` (the default) or `"json"`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0