Skip to content

Support for structured logging (JSON) #437 - #438

Open
4TT1L4 wants to merge 1 commit into
txpipe:mainfrom
4TT1L4:437-Support-for-structured-logging-JSON
Open

4TT1L4 wants to merge 1 commit into
txpipe:mainfrom
4TT1L4:437-Support-for-structured-logging-JSON

Conversation

@4TT1L4

@4TT1L4 4TT1L4 commented Sep 21, 2022 •

Copy link
Copy Markdown
Contributor

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

4TT1L4 commented Sep 21, 2022

Copy link
Copy Markdown
Contributor Author

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

This branch has not been deployed

No deployments
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