celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Broekhuis <a.broekh...@gmail.com>
Subject Re: logging to syslog
Date Tue, 07 Jan 2014 11:25:23 GMT

While I like the usage of syslog, at this moment I don't think it is an
good idea to use it directly from the LogService.

Reasoning for this is, the LogService specification does use an integer,
and specifically mentions the possibility to use additional integers, but,
syslog defined log levels itself, and these levels are different wrt the

So even though it would be possible to use the facility and log level, you
would end up with conflicting meanings. This could be solved by giving all
syslog levels an offset, but I think this is confusing, especially if we
want to add some syslog support (writer) to Celix.

Maybe a better solution would be to duplicate the LogService and create a
SysLogService with the levels and API as defined by SysLog.

2014/1/7 Björn Petri <bjoern.petri@sundevil.de>

> Hi All,
> After having all log levels now prefixed, we implemented a log_writer
> which writes to syslog. Unfortunately I cannot use the facility levels yet
> due to the (existing) log_service interface:
> Within the syslog call itself, the facility and the log levels are
> combined within one integer. The current log_service implementation only
> uses a log_level, represented by an enum. Hence, when using an int instead
> of this enum  I could be able to use the same approach as syslog does. All
> log messages without a dedicated facility code could be logged as LOG_USER
> (I think this would be default syslog behaviour anyway).
> What would speak against changing this? I would appreciate any ideas on
> that topic.
> Another opportunity would be - of course - to have a separate
> logService_syslog, which provides the needed interface.
> Regards,
>   Bjoern

Met vriendelijke groet,

Alexander Broekhuis

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message