tendermint / tmkms

Key Management service for Tendermint Validator nodes
Apache License 2.0
142 stars 42 forks source link

v0.7.0 syntax for errors #384

Open gaia opened 4 years ago

gaia commented 4 years ago

v0.7.0's more forgiving timeouts are a welcome feature, thanks!

I noted that the log syntax changed in v0.7.0. I used the older syntax as a search query in papertrail to get realtime alerts on undesired events, and it used to be [warn] OR [error].

It is now #033[0m#033[31mERROR#033[0m OR #033[0m#033[31mWARN#033[0m. Was this an oversight or will warnings/errors be logged in this format from here on?

tarcieri commented 4 years ago

This was caused by a switch to the tracing crate for logging:

https://github.com/tokio-rs/tracing

That crate is pretty much the permanently planned logging system, however it seems you are getting color logs when you probably don't want color.

It should autodetect if it's running under a TTY and not use colors if it isn't. Are you running it with a TTY?

Otherwise I should probably add a config option for whether or not colors should be used (and/or a command line argument or env var)

gaia commented 4 years ago

Yes, looking at the logs directly in the client (/dev/pts/0) it is formatted properly

Dec 17 16:36:37.265 ERROR tmkms::client:

while via papertrail:

#033[2mDec 17 16:36:37.265 #033[0m#033[31mERROR#033[0m tmkms::client:

weird though is tmkms are the only logs for which this happens in papertrail. it's standard rsyslog for shipping logs to papertrail (with TLS)

How do I disable coloring?

image

tarcieri commented 4 years ago

I will look into adding some configuration to control when it uses colors. It also looks like the TTY detection may have regressed, so I will try to add that back.