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

Long lines will be splitted when journald logs #335

Open
xeor opened this issue May 12, 2022 · 2 comments
Open

Long lines will be splitted when journald logs #335

xeor opened this issue May 12, 2022 · 2 comments

Comments

@xeor
Copy link

xeor commented May 12, 2022

In

conmon/src/ctr_logging.c

Lines 320 to 322 in 2b08734

/* per docker journald logging format, CONTAINER_PARTIAL_MESSAGE is set to true if it's partial, but otherwise not set. */
if (partial && writev_buffer_append_segment(dev_null, &bufv, "CONTAINER_PARTIAL_MESSAGE=true", PARTIAL_MESSAGE_EQ_LEN) < 0)
return -1;
, CONTAINER_PARTIAL_MESSAGE is set static to true. I find no way to turn this off.

This can be problematic example when using ansible tower/awx, which uses conmon/podman to start jobs inside containers running its job since those jobs often contains a bunch of json from ansible. You will end up with a splitted message in journald, which is not even in order..

If you send journald messages to another system as well, you will have no way of putting it together, and it will often break parsing and cause all sorts of problems since there are unbalanced quotes per line.

There should be a way to log without setting CONTAINER_PARTIAL_MESSAGE to true

@haircommander
Copy link
Collaborator

thanks for opening the issue @xeor , do you have any interest in opening a PR?

@xeor
Copy link
Author

xeor commented Jun 4, 2022

sorry for the delay..

I honestly don't think I should try to make a PR for this. I have not been doing a lot (any c programming).
I am working around this by using the logging functionality inside awx/tower instead of journald. So this is still a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants