[RFC] implement log facility using syslog

Christian Hergert christian.hergert at gmail.com
Fri Jul 22 15:32:49 PDT 2011

On Fri, Jul 22, 2011 at 2:34 PM, Marty Jack <martyj19 at comcast.net> wrote:
> 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.

Can syslog() potentially block? If so, that might be an issue of
concern. I don't think it is, at least officially stated, that
syslog() is re-entrant safe (which may be of concern with regard to
how signals are handled).

Anyway, I don't really have the answers to those, just thought I'd mention it.

-- Christian

More information about the wayland-devel mailing list