glog -> syslog?

1,302 views
Skip to first unread message

Dustin Sallings

unread,
Aug 3, 2013, 5:51:52 PM8/3/13
to golan...@googlegroups.com

Is there any interest in having syslog support for glog? I like the
glog inteface, but I send all my logs to syslog.

--
dustin

Brad Fitzpatrick

unread,
Aug 3, 2013, 6:15:06 PM8/3/13
to Dustin Sallings, golang-nuts
It's generally considered unfortunate that the syslog package was even included in the standard library.

I don't think changes will be welcome, as it's just then a reminder that it's there at all.




--
dustin

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Sebastien Douche

unread,
Aug 3, 2013, 6:44:00 PM8/3/13
to Brad Fitzpatrick, Dustin Sallings, golang-nuts
On Sun, Aug 4, 2013 at 12:15 AM, Brad Fitzpatrick <brad...@golang.org> wrote:
> It's generally considered unfortunate that the syslog package was even
> included in the standard library.

can you explain?



--
Sebastien Douche <sdo...@gmail.com>
Twitter: @sdouche / G+: +sdouche

Rob Pike

unread,
Aug 3, 2013, 6:48:15 PM8/3/13
to Sebastien Douche, Brad Fitzpatrick, Dustin Sallings, golang-nuts
The package is a mess because of the sweeping incompatibilities between the syslog implementation on various systems. Its weight is much larger than its worth.

-rob

Rob Pike

unread,
Aug 3, 2013, 6:52:22 PM8/3/13
to Sebastien Douche, Brad Fitzpatrick, Dustin Sallings, golang-nuts
Plus it's not even implemented on windows and the API exposes far too much syscall-like noise that doesn't feel remotely Go-like: syslog.LOG_LOCAL6 anyone?

In short, it's an ugly Unix-specific, non-portable, complex interface given our blessing as a standard API, and we shouldn't have let that happen.

-rob

Shivakumar GN

unread,
Aug 3, 2013, 10:41:43 PM8/3/13
to golang-nuts

Does it make sense to include a heads-up in package documentation to dissuade people from using syslog (and other such cases)?

I was evaluating the syslog package for my usage. Based on above comments I seem to be better of with my own implementation since my need is for a specific OS only and limited in scope.

Rob Pike

unread,
Aug 3, 2013, 11:01:08 PM8/3/13
to Shivakumar GN, golang-nuts
If it works for you, use it. It's not going away.

-rob

Dustin Sallings

unread,
Aug 6, 2013, 1:39:57 PM8/6/13
to golan...@googlegroups.com
Brad Fitzpatrick <brad...@golang.org>
writes:

> It's generally considered unfortunate that the syslog package was even
> included in the standard library.
>
> I don't think changes will be welcome, as it's just then a reminder
> that it's there at all.

To be clear, it's not so much syslog support I want *in* glog, but I'd
like to use glog and syslog (or other log delivery mechanisms) together.

I currently do this with the built-in logger two ways:

1. By turning off timestamps and overriding the Writer at startup.
2. By using logexec[0]

It might be as simple as putting stderr into a variable and making the
timestamp optional (I was going to suggesting making the format
modifiable, but it seems like glog is pretty well beyond that).

Just being able to turn off timestamps might be enough, as I could at
least use logexec (which I often do anyway so I can log panics).


[0]: https://github.com/dustin/logexec

--
dustin

Reply all
Reply to author
Forward
0 new messages