spiral-modules / roadrunner-binary

💾 High-performance PHP application server, load-balancer and process manager written in Golang. RR2 releases repository.
MIT License
44 stars 25 forks source link

[DOCS] endure and plugins logger use different log level naming #48

Closed dstrop closed 3 years ago

dstrop commented 3 years ago

i was trying to set the log level warning but i should have been using warn instead

in https://github.com/spiral/roadrunner-docs/blob/master/beep-beep/logging.md and https://github.com/spiral/roadrunner-docs/blob/master/intro/config.md the log levels are defined as

Levels: panic, error, warning, info, debug. Default: debug.

and

  # Logging level can be "panic", "error", "warning", "info", "debug".

but endure logger and plugins logger use diferent methods to interpret log level

endure: https://github.com/spiral/roadrunner-binary/blob/50d2aaff4655edc2c36ef0d91dbce114267e48f1/internal/container/config.go plugins: https://github.com/uber-go/zap/blob/c23abee72d197be00f17816e336aca5c72c6f26a/zapcore/level.go#L126-L146 called from https://github.com/spiral/roadrunner/blob/009b7009885d8a15e6fa6c7e78436087b2f20129/plugins/logger/config.go#L106

it's confusing for the endure and plugin log level to use different naming it might be good idea to either correct the documentation or correct the code to use the same log level naming

I tried this code:

endure:
  log_level: "warning"

logs:
  mode: production
  level: warning

I expected to see this happen: only warning and higher logs

Instead, this happened: bunch of info logs from plugins specifically metrics plugin

The version of RR used: 2.1.1

rustatian commented 3 years ago

Hey @dstrop . Yeah, thanks for the report. I'll update the documentation. Use warn of course instead of a warning. This is a documentation issue.