Ubuntu – How to read NotifyOSD messages after they are displayed

12.04lognotify-osd

I'd like to read a list of messages displayed by notify-osd from time to time. I'm using 12.04 still, if it matters. Is this possible?

These two questions from 2010 indicate that a log file should exist at ~/.cache/notify-osd.log. I have no such file, and I'd like to know if this is a bug (in which case this question should be closed) or if this log file depends on another setting (like System Settings -> Privacy)?

I don't care about storing data between reboots. I just want to browse messages from the current session.

EDIT: Two good answers now but I'd like to know if these messages are stored anywhere, (total guess, /tmp? RAM?) for a short period after appearing on the screen. Some sort of buffer must exist as they appear one after another, a few seconds each, even if there are 20-30 notifications over the span of a minute or two.

I failed to mention in my original question that I'm not interested in yet another PPA + indicator or excessive drive writes, I just want to know if it is possible to see the messages for a short time after they appear.

My use case for this is to go back and find what song was played a few minutes ago on a streaming radio station. I have it on as background music, and occasionally a tune sticks in my head after I hear it. I have no way of going back to see what played 1-2 songs ago.

Best Answer

After carefully looking around (A LOT) I found a code change in 2011 about making notify-osd not output by default to the log file because this was used for debugging purposes and wrote to the HDD every time it did. To activate this feature you can do it 2 ways, a temporary method and a more permanent one.

Temporary Method

Open the terminal I type the following:

For 64 Bit Systems:

sudo killall notify-osd
LOG=1 /usr/lib/x86_64-linux-gnu/notify-osd &

For 32 Bit Systems:

sudo killall notify-osd
LOG=1 /usr/lib/notify-osd/notify-osd &

Now you will see the .cache/notify-osd.log file and the debug information in it.

Permanent Method (WARNING: Global Change)

For a more permanent solution do the following (Global Change. Read the Warning mentioned by Rinzwind below. This will affect everyone and kill the cat!):

sudo nano /etc/environment

Add the following line at the end and save:

LOG=1

Reboot the computer to test.

Permanent Method (User Specific Change)

For a more permanent solution do the following (User specific Change. This will only affect you and the dog. The cat will still survive.):

sudo nano ~/.bashrc

Add the following line at the end and save:

LOG=1

Reboot the computer to test.

You should see the information start to appear in the .cache/notify-osd.log file. For example, this me after disconnecting 2 times my wired connection:

GNU nano 2.2.6 File: .cache/notify-osd.log

[2013-05-04T18:49:55-00:00, NetworkManager ] Connected
Intel

[2013-05-04T18:50:26-00:00, NetworkManager ] Disconnected - you are now offline
Ethernet network

[2013-05-04T18:50:29-00:00, NetworkManager replaced] Connected
Intel