-
-
Notifications
You must be signed in to change notification settings - Fork 117
Update Atmos logs. Update docs #605
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osterman
reviewed
May 23, 2024
osterman
reviewed
May 23, 2024
osterman
reviewed
May 23, 2024
osterman
reviewed
May 23, 2024
osterman
reviewed
May 23, 2024
osterman
reviewed
May 23, 2024
Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>
Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>
osterman
approved these changes
May 23, 2024
Also relates to #112 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what
/dev/stderr
why
Atmos logs are configured in the
logs
section in theatmos.yaml
CLI config file:logs.file
- the file to write Atmos logs to. Logs can be written to any file or any standard file descriptor, including/dev/stdout
,/dev/stderr
and/dev/null
. If omitted,/dev/stdout
will be used. The environment variableATMOS_LOGS_FILE
can also be used to specify the log filelogs.level
- Log level. Supported log levels areTrace
,Debug
,Info
,Warning
,Off
. If the log level is set toOff
, Atmos will not log any messages (note that this does not prevent other tools like Terraform from logging). The environment variableATMOS_LOGS_LEVEL
can also be used to specify the log levelTo prevent Atmos from logging any messages (except for the outputs of the executed commands), you can do one of the following:
Set
logs.file
or the ENV variableATMOS_LOGS_FILE
to/dev/null
Set
logs.level
or the ENV variableATMOS_LOGS_LEVEL
toOff
Note that when you set the log level to
Debug
orTrace
, Atmos will log additional messages before printing the output of an executed command. For example, let's consider theatmos describe affected
command:With
logs.level: Trace
, andlogs.file: "/dev/stdout"
, all the messages and the command's JSON output will be printed to the console to the/dev/stdout
standard output.This behavior might be undesirable when you execute the command
atmos describe affected
in CI/CD (e.g. GitHub Actions).For example, you might want to log all the Atmos messages (by setting
logs.level: Trace
) for debugging purposes, and also want to parse the JSON output of the command (e.g. by usingjq
) for further processing. In this case,jq
will not be able to parse the JSON output because all the other messages make the output an invalid JSON document.To deal with that, you can set
logs.file
to/dev/stderr
inatmos.yaml
:Now when the
atmos describe affected
command is executed, the additional messages are printed to/dev/stderr
, but the command's JSON output is printed to/dev/stdout
, allowingjq
to parse it without errors.