Skip to content

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 4TT1L4 requested a review from scarmuega as a code owner September 21, 2022 14:42
@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

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

Support for structured logging (JSON)

1 participant