As a more system-wide solution, instead of symlinking the .xsession-errors file in your home directory to /dev/null (and possibly writing a startup script to re-symlink it if something keeps recreating it as a normal text file), you could change where the log is written to in the first place in /etc/X11/Xsession. That file will be overwritten upon updates to the x11-common package, mind.
Excerpt from line ~50 or so (11.10);
Code:
# initialize variables for use by all session scripts
OPTIONFILE=/etc/X11/Xsession.options
SYSRESOURCES=/etc/X11/Xresources
USRRESOURCES=$HOME/.Xresources
SYSSESSIONDIR=/etc/X11/Xsession.d
USERXSESSION=$HOME/.xsession
USERXSESSIONRC=$HOME/.xsessionrc
ALTUSERXSESSION=$HOME/.Xsession
ERRFILE=$HOME/.xsession-errors
If you change the ERRFILE line to instead point to /dev/null, it will discard the log entirely. If you point it to a file in /tmp/ the log will be accessible there if you suddenly need it, but get deleted upon rebooting.
Code:
ERRFILE=/dev/null
# or
ERRFILE=/tmp/$USER-xsession-errors
The good news is that the behavior changes in 12.04 precise to save it thusly in /tmp/. It still logs insane amounts of errors there, but at least the file gets purged every now and then depending on your shutdown/reboot frequency.
Mine is nearly a megabyte after an update of ~7 days. Most of the entries are Gtk/Gdk/GLib warnings, Qt4 QPainter spam and X Bad{Value,Drawable,Window} errors; none of which are a whit of interest to me.
Implied by this is that the drive gets touched and written to regularly. That's inarguably insignificant to most, but if you're on a laptop (that wants to conserve power by limiting drive activity) and/or using an SSD (to which you want to limit your amount of writes anyway), you may want to consider to just take the /dev/null approach -- or mount your /tmp as tmpfs and point your log there.
Bookmarks