using syslog instead of console for messages

Stephan Bergmann sbergman at redhat.com
Tue Aug 28 02:06:43 PDT 2012


On 08/27/2012 08:04 PM, Riccardo Magliocchetti wrote:
> So here's a quick patch, not even compile tested because i have few
> questions to resolve before considering it ready for review:
>
> - what about errors? it looks like SAL does not have a level for errors.
> I'd like to have the errors in vcl/headless/headlessinst.cxx going to
> syslog too. Should i use straight syslog or can i use another facility?

IMO, those uses of fprintf in headlessinst.cxx should be replaced with 
appropriate uses of SAL_INFO/SAL_WARN/assert to begin with.

> - is it ok to initialize syslog in desktop/source/app/sofficemain.cxx?

Should either go to sal_detail_initialize or be done on demand in log.cxx.

> - can you suggests something better than WANT_SYSLOG_LOGS ? :)

Make compilation dependent on HAVE_SYSLOG_H, make the behavior of log() 
dependent on some env var (either extend the syntax of SAL_LOG to also 
contain the target, or add a SAL_LOG_TARGET with values "syslog", 
"stderr", say).

> - should i add a switch for syslog logging to configure so that the
> feature may be used also in other environments? May be useful for large
> deployments i think where you want centralized logs.

I would make it configurable at runtime, see above.

Stephan


More information about the LibreOffice mailing list