19

The helpful companion to the OSX notifications center Growl per default logs all received notifications. You can define how big the log may get or disable logging in the application.

Since the latest update Growl offers to forward all notifications to the OS X Notification Center.

Does OS X log Notifications Center messages as well? If yes, where can I find them?

Why I am asking this:

OS X logs all your downloads in a SQLite 3.x database. I want to know if something similar happens with notifications as well. This could be a privacy issue when thinking of private messages or e-mails if too much information is stored.

5 Answers 5

18

This is an old question, but just in case someone stumbles on it and is specifically worried about the privacy implications of Notification Center, the answer is YES, OS X does keep a log of notifications on disk.

The format is an sqlite database, and it can be found inside this folder:

~/Library/Application Support/NotificationCenter

Inside you'll find at least one .db file for your account, i've seen some that OS X apparently considered corrupt at one point, so they're called .db.corrupt.

Running the strings command on this file will show you a load of binary data, quite a few "NSSomething" class names, and yes, your iMessages, file paths, twitter and facebook notifications and anything else that was sent to Notification Center by an app or the system.

If you want to get rid of that file at a specific point in time, you can kill usernoted temporarily (it'll restart itself) and delete the file in one shot (run this as your user account, not with sudo):

killall usernoted && rm ~/Library/Application\ Support/NotificationCenter/*.db

This will, 99% of the time, catch usernoted while it's temporarily not running, successfully delete the old database, and usernoted will make a new empty one when it starts again.

This isn't a good solution if you're really worried about privacy, but aside from encrypting your system or using a ramdisk for that folder, there really isn't a solution.

3
  • 7
    As of OS 10.10 Mavericks, the notification database appears to be in a temporary directory instead of ~/Library. On my machine it's in $TMPDIR/../0/com.apple.notificationcenter/db/db Commented Mar 12, 2015 at 20:06
  • 1
    Quick way to find the directory for the current user: find /private/var/folders -user $USER -name com.apple.notificationcenter 2>/dev/null
    – user24601
    Commented May 21, 2022 at 17:58
  • 1
    How do I read db-wal? strings seems to decode everything as ASCII.
    – HappyFace
    Commented Aug 29, 2022 at 18:33
15

In Mac OSX (or macos) 10.10 and later, this file has moved. The filename isn't the same for everyone, so you need to do a tiny bit of sleuthing to find it:

  1. Launch 'Activity Monitor' (in /Applications/Utilities)
  2. Seach for the process usernoted, double-click it
  3. Go to the tab "Open files and ports"

It is in a /com.apple.notificationcenter/db subfolder under /private/var/folders.

(thanks to https://stackoverflow.com/questions/26754189/new-location-of-the-notification-center-db-file-in-10-10 for the new location!)

11

Yes, OSX logs the notifications. They are in sqlite3 db and db-wal file.
As in 10.14.6 - Mojave, the path of the file could be found via:

lsof -p $(ps aux | grep -m1 usernoted | awk '{ print $2 }')| awk '{ print $NF }' | grep 'db2/db$' | xargs dirname
1
  • 1
    Thanks! This finds the db-wal file. However, when I try and read it, it asks for a passphrase. Any idea how to get that?
    – jnthnclrk
    Commented Sep 1, 2020 at 19:31
7

On High Sierra 10.4.3 you can locate by the following commands

getconf DARWIN_USER_DIR
/var/folders/60/23gd59655q70qf_ckxjyhrzr0000gn/0/
ls /var/folders/60/23gd59655q70qf_ckxjyhrzr0000gn/0/com.apple.notificationcenter/

There is a db and a db2 folder - appears the database was migrated to db2 in November.

1

Yes, notifications will be added to the Notification Center if you do not confirm/click them when appearing. You can access them by clicking the Notification Center icon in the top right corner of your menu bar.

enter image description here

However, they are all listed under the Growl app and not the originating app, and clicking them does not seem to lead anywhere, so the functionality is a bit limited compared to standard Growl notifications and the Growl Rollup.

This is probably a limitation in how the Growl developers can address the Notification Center, and I presume we'll just need to wait for all apps to incorporate the Notification Center directly (next to/instead of Growl) for a bit more functional notifications.

1
  • 2
    Thanks Gerry, I was aware of this.:) I am looking for a permanent log somewhere in the Library where info about all ever posted notifications is stored. OS X for example logs all your downloads. I'm wondering if something similar happens with notifications as well. That could be a privacy issue when thinking of private messages or e-mails.
    – gentmatt
    Commented Sep 20, 2012 at 14:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .