Add log level and stream docs for the logging service#496
Conversation
|
|
||
| You control which log levels are emitted by setting the `LOG_LEVEL` input (for example in your action's `inputs` in `manifest.yml` or `app.config.yaml`). The runtime filters logs by this level before writing: only messages at or above the configured level are written. For example: | ||
|
|
||
| - If `LOG_LEVEL` is `error`, only `logger.error()` output is written (and typically goes to stderr). Calls to `logger.info()`, `logger.debug()`, and `logger.warn()` are not written at all, so they never appear in the Logs UI or CLI. |
There was a problem hiding this comment.
I think we should remove the second half- "(and typically goes to stderr)". The first half of the sentence where it says that only logger.error() output is written is correct, but it doesn't go to stderr, instead goes to stdout.
I tested it out with a test project. This is because the aio-sdk's Winnston transport does not configure stderrLevels. Hence calls to logger.info(), logger.debug(), and logger.warn() are not written at all w; only logger.error()-however they only show up as stdout log_stream
There was a problem hiding this comment.
added the fix, thank you for checking!
| - If `LOG_LEVEL` is `info`, you get `info`, `warn`, and `error`; `logger.debug()` is not written. | ||
| - If `LOG_LEVEL` is `debug`, all levels are written. | ||
|
|
||
| If you do not see expected `logger.info()` or `logger.debug()` output in the Logs UI or CLI, ensure the action's `LOG_LEVEL` is set to `info` or `debug` (for example `LOG_LEVEL: debug` in the action inputs). The Logs UI filters by stream (stdout or stderr); what appears in each stream depends on what was actually emitted, which is governed by `LOG_LEVEL`. |
There was a problem hiding this comment.
With the change of Line 37 , let's also simplify this line as well to something like -
If you do not see expected logger.info() or logger.debug() output in the Logs UI or CLI, ensure the action's LOG_LEVEL is set to info or debug (for example LOG_LEVEL: debug in the action inputs).
purplecabbage
left a comment
There was a problem hiding this comment.
couple nits, but looks goot
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: