-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
log: support --log-opt tag= #4805
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Code LGTM but I'd love to have some tests and to extend the documentation a bit more.
|
||
Specify a custom log tag for the container. For example: | ||
|
||
`--log-opt tag="{{.ImageName}}"` |
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.
What's the format? What are valid keys and values?
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.
specified in the man page
https://review.rdoproject.org/zuul/buildset/fb366dee96094ad4bb02d1c41fb211b6 is failing in other PRs as well. Do you know what that is? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I'm starting to really hate Go templates, but if we need to do it, we need to do it. Found a few small things, but overall looks good. |
Tests aren't hip. |
Is this something containers.conf should handle also? |
afcc651
to
ab2acb4
Compare
@giuseppe could you respond to all of the questions above? |
I was still looking into adding tests. We currently have all tests disabled for journald and checking whether the tag is correctly added will probably need to use
since it is backend specific, should we have a way to specify |
We have LogSizeMax which maybe should be changed to log_opt,since this seems to be specific to file. |
comments are addressed, but tests are missing |
support a custom tag to add to each log for the container. It is currently supported only by the journald backend. Closes: containers#3653 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
added a test but the journald tests are not enabled in the e2e tests. I'll try to enable them as a follow up PR |
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
What error will I see if I try to use log-opt without journald? |
right now it will be silently ignored. I think it should be fixed in conmon, I'll open a PR to address it |
PR opened here: containers/conmon#115 |
/lgtm |
support a custom tag to add to each log for the container.
Closes: #3653
Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com