Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When a GUI program malfunctions in some way (crashes, etc.) I often use the trick of running it from the command line (instead of from the menu). That way I see the messages it outputs to stdout and stderr which sometimes gives me a clue as to what went wrong (or at least a message I can Google to take me further down the "solution path").

Is there any way I can get all GUI programs to save their stdout and stderr somewhere so I can diagnose problems without having to start them from the command line? Not only would this be more convenient, it would help users who don't know about this trick.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

You mean, like the existing ~/.xsession-errors log?

Unfortunately it tends to get filled with lots of warnings & other useless messages.

share|improve this answer

For a particular menu command, you can change the command that start the application, for example with alacarte in gnome, to become something similar to:

command >~/log/command.out.log 2>~/log/command.err.log

where ~/log is a directory previously created, and command should be substituted with a real command name.

If that do not work, embed the command in a shell invocation:

sh -c 'command >~/log/command.out.log 2>~/log/command.err.log'

Unfortunately, I fear there is no general solution.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.