-
Notifications
You must be signed in to change notification settings - Fork 944
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
Allowed and default values for LOG_FORMAT
and LOG_FORMAT_FILE
#5578
Merged
Conversation
This file contains 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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
github-actions
bot
added
content
Improvements or additions to content
size: x-small
This change will take under 3 hours to fix.
labels
May 29, 2024
iamtodor
reviewed
May 29, 2024
github-actions
bot
added
size: medium
This change will take up to a week to address
and removed
size: x-small
This change will take under 3 hours to fix.
labels
May 30, 2024
dbeatty10
commented
May 30, 2024
github-actions
bot
added
size: small
This change will take 1 to 2 days to address
and removed
size: medium
This change will take up to a week to address
labels
May 30, 2024
github-actions
bot
added
size: medium
This change will take up to a week to address
and removed
size: small
This change will take 1 to 2 days to address
labels
May 30, 2024
github-actions
bot
added
size: small
This change will take 1 to 2 days to address
and removed
size: medium
This change will take up to a week to address
labels
May 30, 2024
@dbeatty10 thank you! |
iamtodor
approved these changes
May 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🔥
matthewshaver
approved these changes
May 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dbeatty10
This was referenced Jun 6, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
content
Improvements or additions to content
size: small
This change will take 1 to 2 days to address
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.
Preview
What are you changing in this pull request and why?
resolves #5577
Allowed and default values are in the source code here.
TLDR
The
LOG_FORMAT
andLOG_FORMAT_FILE
global config flags in dbt control the format of log outputs. There are three formats:text
Example:
debug
logs/dbt.log
file.Example:
json
Example:
Note: The
debug
log format should not be confused with thedebug
log level. Thelog level
determines the number of log messages, while thelog format
determines the detail in each log message.More info
There are two different sub-classes of
_Logger
:_TextLogger
(default)_JsonLogger
_TextLogger
has two different line formats:DebugText
(default)PlainText
below except it includes a header at the beginning of each invocation (which has a timestamp and the invocation ID) and each message includes the log level of the message, thread ID, and the timestamp has a microsecond precision using the Python system time zonePlainText
DebugText
above except it does not include a header at the beginning of each invocation and each message does not include the log level of the message or the thread ID. The timestamp for each message has a second precision represented in UTC._JsonLogger
has a single line format:Json
Those (3) line formats correspond to the options for the
LOG_FORMAT
andLOG_FORMAT_FILE
global config flags:debug
->DebugText
line format (default for thelogs/dbt.log
file) outputs unstructured text with more metadata at the beginning of each log line and upon each dbt invocationtext
->PlainText
line format (default for console output) outputs unstructured text with minimal metadata at the beginning of each log line and none upon each dbt invocationjson
->Json
line format outputs structured JSON-LWarning
The
debug
log_level
can easily be confused with thedebug
log_format
since they have the same name. But thelog_level
andlog_format
are independent configurations whose options can be mixed'n'matched.Think of log levels as affecting the total number of log messages and the log format as affecting the length of each log message: the
debug
log level includes the maximal number of log messages whereas thedebug
log format includes more detailed information per log messagee.g. The
debug
log level filters out the least number of potential log messages -- none! And thedebug
log format has longer lines because it includes the most detailed debugging metadata per log message.To avoid confusion, we would have been better off giving the
debug
log format a unique name instead (likedetailed
). A better name for thetext
log format would have beenbasic
,simple
, orbrief
.Note
I don't know the precision reasons why the
PlainText
line format is in UTC with low-resolution while theDebugText
with a local time zone and high resolutionChecklist