Ask Your Question

Where does stdout from applications go to when started in gnome (F20)?

asked 2014-02-06 08:01:21 -0600

mlipp gravatar image

updated 2014-02-09 02:33:25 -0600

FranciscoD_ gravatar image

When I start an application in gnome (F20), I want to see what it has written to stdout/stderr if it behaves strangely. Of course, I can start it in a terminal. But then I'd have to know beforehand that the application will behave strangely later. (Or I start everything in a terminal by default which is not really an option.)

Searching for this in the web, I found some interesting answers, but obviously they are all outdated. Traditionally, output used to go to $HOME/.xsession-errors (actually, I knew about that one, but it isn't there any more). I also found some patch that seems to have replaced that with $XDG_HOME/.cache/gdm/session.log (doesn't exist either). In Ubuntu, the output currently seems to end up in $HOME/.cache/upstart/gnome-session.log (but F20 uses systemd). Of course, I checked the output of journalctl, nothing there. Any hint appreciated.

edit retag flag offensive close merge delete


gdm puts the logs in the system journal (c.f. this ), I tested by starting konqueror and went to "info:coreutils", the same kind of errors I used to see in ~/.xsession-errors were displayed in the systemd journal.

Ahmad Samir gravatar imageAhmad Samir ( 2014-02-06 08:33:55 -0600 )edit

I cannot think why you don't have an .xsession-errors file, but I have. (Fedora 20). Only the stderr goes there (I guess from the name).

NickTux gravatar imageNickTux ( 2014-02-06 08:46:02 -0600 )edit

Note that starting an application in a terminal is not the same as starting it with Gnome menu (terminal is attached or not). If you want to mimic starting application with gnome - launch the desktop file with gtk-launch as described here: . I can also see that there are indeed some log files (per application) under find ~/.cache -name "*.log"

marcindulak gravatar imagemarcindulak ( 2014-02-06 13:00:24 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-08-28 10:35:06 -0600

mwilck gravatar image

As Ahmad already commented, the logs go to the systemd journal. In order to read them, first find out the systemd unit that belongs to your session (which is a systemd unit of type "scope"). Then use that session as unit for journalctl, like this:

$ systemctl list-units -t scope
UNIT                             LOAD   ACTIVE SUB     DESCRIPTION
session-5.scope                  loaded active running Session 5 of user martin
$ journalctl -b -u session-5.scope

You could create a shortcut for this in bash, like this:

alias xsession-errors='journalctl -b -u $(systemctl -t scope | awk "/user $USER\$/ { print \$1; }")'

With this alias, you can view your logs simply by typing xsession-errors.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-02-06 08:01:21 -0600

Seen: 1,716 times

Last updated: Aug 28 '14