Skip to content
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

Spoof json-file logging support #3375

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/podman-create.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ Not implemented

**--log-driver**="*k8s-file*"

Logging driver for the container. Currently not supported. This flag is a NOOP provided solely for scripting compatibility.
Logging driver for the container. Currently available options are *k8s-file* and *journald*, with *json-file* aliased to *k8s-file* for scripting compatibility.

**--log-opt**=*path*

Expand Down
2 changes: 1 addition & 1 deletion docs/podman-run.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ Not implemented

**--log-driver**="*k8s-file*"

Logging driver for the container. Currently not supported. This flag is a NOOP provided solely for scripting compatibility.
Logging driver for the container. Currently available options are *k8s-file* and *journald*, with *json-file* aliased to *k8s-file* for scripting compatibility.

**--log-opt**=*path*

Expand Down
4 changes: 3 additions & 1 deletion libpod/oci_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ func (r *OCIRuntime) createOCIContainer(ctr *Container, cgroupParent string, res
}

logDriver := KubernetesLogging
if ctr.LogDriver() != "" {
if ctr.LogDriver() == JSONLogging {
logrus.Errorf("json-file logging specified but not supported. Choosing k8s-file logging instead")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a Warnf not an Errorf.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really want to keep the Errrof here - we need to make it very obvious that they should switch to k8s-file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be fine either way, I'll let you two decide. I will weigh in that the only reason a user cares about the difference is if they want to read the log as a json. If we leave it as a warning, and document it, we can point users to the fact they can't read it as json, and thus not have a loud error.

} else if ctr.LogDriver() != "" {
logDriver = ctr.LogDriver()
}
args = append(args, "-l", fmt.Sprintf("%s:%s", logDriver, ctr.LogPath()))
Expand Down