View previous topic :: View next topic |
Author |
Message |
bender86 Guru
Joined: 18 Mar 2005 Posts: 484
|
Posted: Sun Jun 12, 2022 8:02 am Post subject: Xorg logs in journalctl |
|
|
Is there a way to make Xorg log to journalctl?
I am trying to debug some X/Wayland issue, and it would be quite useful to get all logs from a single source, and also to access logs from many different past boots.
Apparently some distributions do that*, so it should be possible, but I have not found any information about it.
* https://who-t.blogspot.com/2014/03/viewing-xorglog-with-journalctl.html |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3914
|
Posted: Sun Jun 12, 2022 10:39 am Post subject: |
|
|
Ok try
Code: |
ls -l /etc/systemd/system/display-manager.service
|
you will see a link to you DM.
In my case is lightdm
Then
Code: |
systemctl edit --full lightdm.service
|
Then change
Code: |
StandardOutput=syslog
|
to
Code: |
StandardOutput=journal
|
Then see the messages
Code: |
journalctl -b -u lightdm
or
journaltcl -u lightdm
|
plz see
Code: |
StandardOutput=
Controls where file descriptor 1 (STDOUT) of the executed processes is connected to. Takes one of
inherit, null, tty, journal, syslog, kmsg, journal+console, syslog+console, kmsg+console or socket.
|
_________________
|
|
Back to top |
|
|
bender86 Guru
Joined: 18 Mar 2005 Posts: 484
|
Posted: Sun Jun 12, 2022 11:34 am Post subject: |
|
|
I use gdm, and I already get all gdm log messages in journalctl.
Xorg messages still go to Code: | ~/.local/share/xorg/Xorg.X.log |
|
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3914
|
Posted: Sun Jun 12, 2022 11:55 am Post subject: |
|
|
Code: |
~/.local/share/xorg/Xorg.X.log
|
Are you using Gentoo?
I have no such file.
I have instead
Code: |
/var/log/Xorg.0.log
|
_________________
|
|
Back to top |
|
|
bender86 Guru
Joined: 18 Mar 2005 Posts: 484
|
Posted: Sun Jun 12, 2022 12:04 pm Post subject: |
|
|
alamahant wrote: | Are you using Gentoo? |
Of course I am using Gentoo.
Why would I ask in this forum otherwise...?
alamahant wrote: | I have no such file.
I have instead
Code: |
/var/log/Xorg.0.log
|
|
If you install x11-base/xorg-server without USE suid (which is indeed disabled by default), Xorg runs as a standard user and cannot write in /var/log, so it does in your home directory.
Or something like that. I am not very experienced with Xorg.
Perhaps this is the default behaviour only on systemd and you are using OpenRC? |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3914
|
Posted: Sun Jun 12, 2022 12:50 pm Post subject: |
|
|
Your log location is mistaken.
It should be
Code: |
~/.local/share/xorg/Xorg.0.log
|
In both systemd and openrc I get logs both in user home dir and /var/log(slightly different).
And i have USE="-suid" in xorg-server. _________________
|
|
Back to top |
|
|
bender86 Guru
Joined: 18 Mar 2005 Posts: 484
|
Posted: Sun Jun 12, 2022 12:53 pm Post subject: |
|
|
alamahant wrote: | Your log location is mistaken.
It should be
Code: |
~/.local/share/xorg/Xorg.0.log
|
|
That is the one I wrote. I do have a logfile there, but I do not want a log file at all. I want it in journald.
alamahant wrote: | In both systemd and openrc I get logs both in user home dir and /var/log(slightly different).
And i have USE="-suid" in xorg-server. |
I have nothing in /var/log |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3914
|
Posted: Sun Jun 12, 2022 1:01 pm Post subject: |
|
|
bender86 wrote: | I use gdm, and I already get all gdm log messages in journalctl.
Xorg messages still go to Code: | ~/.local/share/xorg/Xorg.X.log |
|
No you wrote something different.
Anyway apparently X logging location in systemd env is controlled by DM.This is according to all available info.
Maybe open a bug report for gdm.
They will be able to enlighten you better. _________________
|
|
Back to top |
|
|
bender86 Guru
Joined: 18 Mar 2005 Posts: 484
|
Posted: Sun Jun 12, 2022 1:10 pm Post subject: |
|
|
alamahant wrote: | bender86 wrote: | I use gdm, and I already get all gdm log messages in journalctl.
Xorg messages still go to Code: | ~/.local/share/xorg/Xorg.X.log |
|
No you wrote something different. |
What did I write different? The X was a placeholder, there are multiple log files depending on the VT/Server number (or something else, I cannot remember exactly what field it is).
alamahant wrote: | Anyway apparently X logging location is controlled by DM.This is according to all available info. |
Where did you find this information? Perhaps I can start from there to understand better.
alamahant wrote: | Maybe open a bug report for gdm.
They will be able to enlighten you better. |
The original link I posted links an ancient issue on GDM issue tracker. As far as I understand, GDM already supports it and it does so by default on Fedora, but I cannot find any documentation on how to enable it on Gentoo. |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3914
|
|
Back to top |
|
|
|