ava-labs / subnet-evm

Launch your own EVM as an Avalanche Subnet
https://docs.avax.network/subnets/create-a-fuji-subnet
GNU Lesser General Public License v3.0
237 stars 213 forks source link

truncate err data logs #1213

Closed ceyonur closed 5 days ago

ceyonur commented 2 weeks ago

Why this should be merged

How this works

How this was tested

How is this documented

darioush commented 2 weeks ago

I think it would be nicer to:

ceyonur commented 2 weeks ago

I think it would be nicer to:

* Apply the fix to the logger itself, where all string / variable length outputs are truncated at a certain limit

* Make the limit configurable and apply a default

I looked at the code, unfortunately we don't own JSON & Logfmt handlers, and ReplaceAttr for those handlers do not take any usable parameters so we can start truncating them in replace functions (builtinReplace). The closest (and probably that does not require a huge refactor) place is the upstream's logger's Write.

I can create a PR to upstream to get their feedbacks on this.