Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for structured logging (JSON) #437 #438

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

4TT1L4
Copy link
Contributor

@4TT1L4 4TT1L4 commented Sep 21, 2022

Added json_logs feature and made the used logging library dependent on the current feature flag setting.

Fixes #437:

 - Added json_logs feature and made the used logging library dependend on the current feature flag setting.
@4TT1L4
Copy link
Contributor Author

4TT1L4 commented Sep 21, 2022

The logging seems to be working as expected. It is possible to switch between env_logger and json_env_logger2 using the json_logs feature:

image

I used the following configuration for testing:

[source]
type = "N2N"
address = ["Tcp", "relays-new.cardano-mainnet.iohk.io:3001"]
magic = "mainnet"

[source.mapper]
include_block_end_events = false
include_transaction_details = true
include_transaction_end_events = false
include_block_cbor = false
include_byron_ebb = false

[[filters]]
type = "Selection"

[filters.check]
predicate = "variant_in"
argument = ["Block","Transaction","RollBack"]

[sink]
type = "Stdout"

The following commands seem to work as expected:

cargo run -- daemon --config ./mainnet_tcp_config.toml
cargo run --features json_logs -- daemon --config ./mainnet_tcp_config.toml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Support for structured logging (JSON)
1 participant