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
OS-7052 zoneadmd should create bunyan formatted logs #290
Conversation
I mentioned it in the ticket, but in case you're wondering.. since the output we need to log could contain embedded NULs, which would complicate using libbunyan (since it'd end up being escaped incorrectly because libbunyan would then escape the escaping) libbunyan does a lot of allocations for every message. Since we're already forming json, and just need to output a few extra properties to make the output Bunyan-compatible, I went that route. It also seems like since it's using fixed sized buffers allocated at startup, if a system gets into a bad spot, it might be more likely to be able to capture and log something. |
usr/src/cmd/zoneadmd/log.c
Outdated
|
||
/* Buffer is too full to append "\\n". Force a flush. */ | ||
if (flushp != NULL && i >= dlen - 2) { | ||
/* Buffer is too full to append "\\n" + NUL. Force a flush. */ |
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'm confused by this existing code and the new version. What appended newline?
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'm not sure either -- I think this was all to try to force a flush if the escaped version was too large to fit into the output buffer. Since custr_t already handles that, I think the setting of flushp and breaking out of the loop of the custr_append() call fails should handle that. I'll update accordingly.
No description provided.