Bug 35473 - Ability to log to syslog
Summary: Ability to log to syslog
Status: RESOLVED WORKSFORME
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: All All
: medium enhancement
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-20 14:27 UTC by Jérôme Carretero
Modified: 2018-10-24 02:24 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Jérôme Carretero 2011-03-20 14:27:42 UTC
It would add a minimum LOC in xorg-server to provide the ability to log to the syslog.
X is currently one of the last mainstream daemon which does not provide a way to log to the syslog.
Using syslog provides control over the way the logs are processed (eg. buffered writes which are nice on SSDs, destination control, ignores, log rotation).

A lot of troubleshooting guides are talking about reading /var/log/Xorg.0.log for info, so I don't think disabling the current logging system by default would be wise...

Basically, the syslog-only part of os/log.c would look like :

#define SYSLOG_NAMES
#include <syslog.h>

const char * LogInit(const char *fname, const char *backup) {
  openlog("Xorg", 0, LOG_LOCAL0);
  return "/dev/null";
}

void LogClose(void) {
  closelog();
}

void LogVWrite(int verb, const char *f, va_list args) {
  vsyslog(LOG_INFO, f, args);
}
Comment 1 Marcin Szewczyk 2015-03-10 12:44:41 UTC
Is there any decision concerning this request?
Comment 2 Alan Coopersmith 2015-03-10 14:48:36 UTC
No, there is no decision - it's not rejected, but no one has yet thought its
useful enough to spend the time writing the code to make it happen.

There are far more things X could do than people with time to do them.
Comment 3 Peter Hutterer 2015-03-18 01:00:39 UTC
fwiw, GDM now starts the X server to log exclusively to stdout and GDM then forwards this to the systemd journal. Any reason this can't be done for syslog?
Comment 4 Jérôme Carretero 2018-10-24 01:51:30 UTC
At the time the issue was open I hadn't thought about using stdout or stderr as eg. gdm is doing, which is flexible enough to close the issue.
Comment 5 Peter Hutterer 2018-10-24 02:24:38 UTC
ok, thanks for the update, closing this now.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.