Nomad: Rotate log files at newline boundaries

Created on 7 Apr 2016  路  8Comments  路  Source: hashicorp/nomad

Issue

See comment: https://github.com/hashicorp/nomad/pull/1047#discussion_r58810636 . The following needs to happen in Write() when the file size has been exhausted.

This should scan backwards through the buffer for a \n and write/flush everything before that. Whatever comes after that last \n should be moved to the beginning of the buffer and written out on the next write (as long as the line length is less than the buffer length, in which case you need to truncate). This only needs to happen on file rotation, not on write.

themclient typbug

Most helpful comment

@lorenzo Not out of scope. We haven't been able to prioritize it yet, sorry!

Please do vote on the parent issue with :+1: -- Github allows us to sort issues by upvotes, and we do use that when planning.

All 8 comments

@diptanu did #1047 fix this issue? Can this issue be closed?

Any news?
Our applications logs are in json format and parsed by Logstash but Nomad truncate lines when rotating log files. So these json lines are invalid...

I have the same problem as @cyrilgdn

@diptanu @sean- This issue seems to not be fixed currently. Is it planned for some version?

Thanks!

We don't have it on our roadmap yet, but if someone wants to attempt a PR @sean-'s linked comment covers the desired behavior.

We are experiencing this as a problem because we log in json format. Is this still out of scope?

@lorenzo Not out of scope. We haven't been able to prioritize it yet, sorry!

Please do vote on the parent issue with :+1: -- Github allows us to sort issues by upvotes, and we do use that when planning.

Cc: @preetapan

Was this page helpful?
0 / 5 - 0 ratings