oura
oura copied to clipboard
Support for structured logging (JSON) #437
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
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:
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