-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add <log> directive to <system> #1644
Conversation
@time_format = nil | ||
@formatter = nil | ||
|
||
self.format = :text |
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.
Why not @format = :text
?
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.
Need to set other default values: https://github.com/fluent/fluentd/pull/1644/files#diff-d845866477e75d27b77c4b8acc63c7d9R163
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.
I see.
I added a very small comment. Other than that LGTM. |
@@ -426,7 +491,7 @@ def caller_line(type, time, depth, level) | |||
else | |||
"".freeze | |||
end | |||
log_msg = "#{time.strftime(@time_format)}[#{LEVEL_TEXT[level]}]: #{worker_id_part}" | |||
log_msg = "#{time.strftime(@time_format)} [#{LEVEL_TEXT[level]}]: #{worker_id_part}" |
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.
Can't this log pattern be customizable as well?
For example, it may be necessary to have patten like [time][log_level] message
to parse it easily.
It could be a customizable part of text
format or a new format, let's say custom
.
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.
For example, it may be necessary to have patten like [time][log_level] message to parse it easily.
For easy to parse, format json
is enough.
Will there be any documentation updates? Unfortunately, I'm not deeply familiar with the repository's structure, but I didn't where the docs are stored. |
Visit fluentd-docs repository. |
This directive controls fluentd's log behaviour
Now, support two parameters:
text:
json:
time_format %Y
I have a plan to move some logging related parameters to under
<log>
likelog_level
.