oura icon indicating copy to clipboard operation
oura copied to clipboard

Support for structured logging (JSON) #437

Open 4TT1L4 opened this issue 1 year ago • 1 comments

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

Fixes #437:

  • https://github.com/txpipe/oura/issues/437

4TT1L4 avatar Sep 21 '22 14:09 4TT1L4

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

4TT1L4 avatar Sep 21 '22 14:09 4TT1L4