[RFC] implement log facility using syslog
Marty Jack
martyj19 at comcast.net
Fri Jul 22 14:34:25 PDT 2011
On 07/22/2011 04:01 PM, Tiago Vignatti wrote:
> Hi all,
>
> I wanted to use an already existent library for logging; the first that came
> to my mind was one with syslog interface. I like because there is a lot of
> implementations around, it's simple and kinda flexible. For instance, I can get
> the whole system log together with the Wayland one if I want, or just the
> latter separately. One even could send the logs over through the network to a
> remote server or output it to a named fifo.
>
> However, it seems people are not that excited anymore with syslog
> implementations for some reason and implementing their own mechanism for each
> software [0]. I tend to see also a bunch of Meego applications dumping log on
> .xsession-errors. I don't get it, really!
>
> A drawback I see, is that it requires a small intervention on the system
> configuration, having to edit a shared file (/etc/syslog.conf) in a way to
> route the messages for a particular location, say /var/log/wayland.log. So I'm
> assuming and hardcoding LOG_LOCAL0 for wayland now. Ugly.
>
> I'd like to hear your first feedback regarding the usage of syslog and also
> regarding the API for logging. If the discussions will be too tense on the
> syslog stuff then I think we just go for own compositor's logging
> implementation.
>
> Thanks!
>
> [0] http://lists.freedesktop.org/archives/systemd-devel/2011-June/002682.html
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
The primary reason you wouldn't use syslog to log user messages is that it opens the possibility for an unprivileged user process to maliciously consume the root partition. Logging to the equivalent of ~/.Xsession-errors is the right way to go because it puts the log traffic into the user's home directory. It would be okay to use syslog or a log file in /var/log or such to log messages from the system compositor that pertain to things that happen outside of when a user is logged in.
More information about the wayland-devel
mailing list