Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make logging verbosity configurable per package for verbose packages. #10203

Closed
1 task
indam23 opened this issue Nov 15, 2021 · 3 comments · Fixed by #10614
Closed
1 task

Make logging verbosity configurable per package for verbose packages. #10203

indam23 opened this issue Nov 15, 2021 · 3 comments · Fixed by #10614
Assignees
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework cse-issues effort:atom-squad/2 Label which is used by the Rasa Atom squad to do internal estimation of task sizes. type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR

Comments

@indam23
Copy link
Contributor

indam23 commented Nov 15, 2021

What problem are you trying to solve?

Logs from pika (rabbitmq) and kafka libraries can be very verbose, cluttering debug logs.
Usually turning on --debug mode is done to debug model prediction.

What's your suggested solution?

Make logging configurable for the more verbose libraries separately from overall log level.
These could be env vars e.g. PIKA_DEBUG_LEVEL, KAFKA_DEBUG_LEVEL.

Some investigation required to see which other libraries are most verbose; these are the most obvious ones.

Examples (if relevant)

No response

Is anything blocking this from being implemented? (if relevant)

None known

Definition of Done

  • logging made configurable for specific overly verbose packages [Kafka, Pika, matplotlib for starters]
@indam23 indam23 added type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR area:rasa-oss 🎡 Anything related to the open source Rasa framework labels Nov 15, 2021
@b-quachtran
Copy link
Contributor

Would be great to get an option for this in Rasa X as well

@TyDunn TyDunn added the effort:atom-squad/2 Label which is used by the Rasa Atom squad to do internal estimation of task sizes. label Dec 17, 2021
@tayfun tayfun self-assigned this Dec 29, 2021
@tayfun
Copy link
Contributor

tayfun commented Dec 31, 2021

I've been working on this ticket. There are a few problems that I can see:

  1. First is that we already have LOG_LEVEL_LIBRARIES which is not documented, and not used for matplotlib correctly (eg. loaded modules are printed by matplotlib because the parent logger level is not set with LOG_LEVEL_LIBRARIES). I can fix that easily and also add a specific setting just for matplotlib/kafka/pika etc.

  2. Current default log level is INFO. So when we run rasa shell we see INFO logs (and other higher level logs ie. WARNING, ERROR, CRITICAL). Docs say default is None which is actually correct but None for verbosity actually means INFO in practice :) This also means that -v doesn’t do anything as it should be setting log level to INFO and this is default as I’ve said. What do we want default log level to be? I feel INFO level is what everyone really uses so that we can see what’s going on, so this should stay? I can update docs to say INFO is default but then -v doesn’t do anything and we’d be missing ERROR (though we do have --quiet for WARNING which is good enough I think - it’s also normally the default for Python programs as in root logger comes with WARNING level).

Note we had already worked on a similar problem with #6900

I'm planning on adding specific log levels for 3 of the libraries (rabbitmq, matplotlib and kafka). I'm renaming pika to rabbitmq since it is really about connecting to RabbitMQ and also because the loggers to disable are aio_pika and aiormq.

@tayfun
Copy link
Contributor

tayfun commented Dec 31, 2021

Just noticed in addition to undocumented LOG_LEVEL_LIBRARIES we also have the ability to set loglevel in endpoint configuration, but only for kafka at the moment :D (pika does not have this capability).

I wonder what is the best policy here? Options are:

  1. Env variables for general (LOG_LEVEL_LIBRARIES) and specific libraries can override (LOG_LEVEL_RABBITMQ etc.)
  2. For matplotlib etc. use 1 but for endpoints, use its own config so support loglevel in endpoints.yml file for pika etc.
  3. Support a single logging config file from where you can easily set log levels for everything (this is most advanced but requires a bit more knowledge).

tayfun pushed a commit that referenced this issue Dec 31, 2021
tayfun pushed a commit that referenced this issue Dec 31, 2021
tayfun pushed a commit that referenced this issue Dec 31, 2021
tayfun pushed a commit that referenced this issue Jan 5, 2022
* Make library level logging to be configurable

Fixes #10203

* Create log level documentation under cheatsheet in Rasa docs

* Add log docs to `rasa shell --debug` (and others)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework cse-issues effort:atom-squad/2 Label which is used by the Rasa Atom squad to do internal estimation of task sizes. type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants