Repository navigation
Add syslog logging driver - #11458
Conversation
|
Can you please sign your commits following these rules: The easiest way to do this is to amend the last commit: $ git clone -b "syslog" [email protected]:ibuildthecloud/docker.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -fThis will update the existing PR, so you do not need to open a new one. |
There was a problem hiding this comment.
It shouldn't be impossible to get docker logs to work with syslog, although I'm ok with it not making it in right away
There was a problem hiding this comment.
@sirupsen Yup, I think it's totally possible.
@ibuildthecloud We write not JSON to syslog if I'm understanding code right.
There was a problem hiding this comment.
Was just about to say something similar. This document says it writes JSON, but the example output in the PR description isn't JSON.
There was a problem hiding this comment.
@LK4D4 thats right. I initially started off with a JSON logger and then changed it. I'll fix the docs
|
There's a bunch of other docs where you need to add it, especially as a CLI example. The initial PR points out those places. Also needs some tests. Other than that, this looks good. |
There was a problem hiding this comment.
The container id is too long and takes up a large portion of the log line.
|
One caveat with writing to syslog is that If we want to handle this, the only solution to this is to drop log entries if writing to syslog blocks. I can't think of any way of doing this other than introducing a channel and starting up a goroutine which reads off the channel and calls |
|
@phemmer also there is bug in golang syslog package golang/go#5932 :( I solved it with copying std syslog and adding |
|
@ibuildthecloud I don't know actually how to do this, because |
I don't follow. There's a buffer somewhere, that buffer is going to get full, and something is going to block (unless we're already discarding data when buffers fill up). |
|
@LK4D4 I updated the code based on the comments and added documentation following the |
There was a problem hiding this comment.
This entry is unfortunately too long and is causing a test to fail.
There was a problem hiding this comment.
Haha :) Probably we should remove listing of all possible drivers.
ec0174e to
fe04889
Compare
|
Nice, moving to code review |
There was a problem hiding this comment.
I should vote for Sprintf here as it is more readable
There was a problem hiding this comment.
Should this be lower case?
There was a problem hiding this comment.
The name of json-file driver is 'JSONFile', I saw that and used 'Syslog' here.
Signed-off-by: wlan0 <[email protected]>
|
I pulled in the latest commit from @wlan0, I think all changes have been addressed at this time. |
There was a problem hiding this comment.
Nitpick: containers => container's
|
cool it works! I do really like how simple the implementaion is too |
|
LGTM |
|
LGTM |
|
👍 thanks to all for the syslog functionality. |
There was a problem hiding this comment.
Sorry, but this mutex seems not to be anywhere
|
We'd like to be able to specify the socket to use instead of |
|
@jberryman Yup, is is easy to add it when |
|
Some new ideas around it #13726. Could you guys please take a look? |
This PR adds support for logging to syslog from Docker by using the go built in syslog package. This code uses the existing logging driver framework added to Docker 1.6. An example output to syslog looks like
NOTE: Credit goes to @wlan0 for the development of this, I'm just submitting the PR