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
log/syslog: formatting issue #5803
Labels
Milestone
Comments
Comment 3 by jonas@pfenniger.name: Heh, the log/syslog package is good given the year of inherited legacy in the format. I had a look and it seems that only linux provides a syscall ( SYS_SYSLOG = 103 ) ? But I don't really understand "library routine", I'll have to take a look at os/user more closely. Another different of the socket connection I just found out is that the program will fail to open the socket if the syslog server is down (obviously). Other programs keep logging in the void happily. |
Comment 4 by jgc@cloudflare.com: Is the main issue here that syslog.go inserts the hostname when on a unix socket? This actually fails with the standard syslog-ng configuration post 3.2. |
Comment 5 by jonas@pfenniger.name: By looking at the glibc[1] it seems that the local format doesn't have the hostname and the time sprintf format is "%h %e %T". The equivalent in Go is time.Stamp instead of time.RFC3339 that we're currently using. I also don't see the "\n" ending logic but see a \0 added if the stream is a SOCK_STREAM. [1]: http://repo.or.cz/w/glibc.git/blob/6d52618b15cbe25ed4822ac51321db292f28ccda:/misc/syslog.c |
Comment 6 by jonas@pfenniger.name: Here is the output I get on Linux with `strace -s 1024 ./a.out` after compiling the attached foo.c program: sendto(3, "<141>Jul 9 11:26:41 exampleprog[21978]: TESTING", 48, MSG_NOSIGNAL, NULL, 0) = 48 I tried running dtruss on OSX to see if the format was the same but I don't see a write or sendto in the output... Attachments:
|
Comment 7 by jonas@pfenniger.name: The hg tools drive me nuts. Attached you'll find a patch that changes the syslog formatting when sending locally. I tested it on Ubuntu and OSX. Attachments:
|
Comment 9 by jonas@pandastream.com: I don't know if it's intentional but the contribution difficulty is relatively high. Not only am I not familiar with Mercurial but I also don't know what applies (eg: from tutorials) since the codereview system seem to be changing some of it's semantic. Now I'm getting a cryptic error and I get I'll have to do some python spelunking to find the root cause. $ hg change Issue created. URL: https://golang.org/cl/11988043 Sun Jul 28 15:29:45 2013 uploading change to description abort: HTTP Error 403: Forbidden |
Comment 11 by jonas@pandastream.com: Ok I finally got around to make the codereview working. upload.py is a much easier method than the mercurial plugin. This is a solution for the current release: https://golang.org/cl/12680048 This is a solution against 17413:2fe813f4f3c2 : https://golang.org/cl/12671045 |
Sorry I'm having some issues with the codereview tool, seems like google apps account aren't working properly. In any case here is another revision of the patch: https://golang.org/cl/12717044/ |
This issue was closed by revision 87a6d75. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by jonas@pfenniger.name:
The text was updated successfully, but these errors were encountered: