*nix convention for storing user logs?

Solution 1:

I would suggest going for /var/log/foo.uid/, because /var/log/ is my first go-to place when searching for logs on a server.

Another option is to use your first choice, ~/.foo/logs/, and create a symlink to it under /var/log.

Solution 2:

While /var/log is the canonical place to look for logs, as @pkhamre points out, I do not see the need to pollute the folder with "user"-generated logs. I would prefer only system-wide services to log to /var/log.

That said, if the app is a GUI app (running in X), I would suggest following the XDG Base Directory Specification and drop the logs into $XDG_DATA_HOME/foo/log/ with $XDG_DATA_HOME defaulting to $HOME/.local/share. This has one drawback, though. You need to work harder if you want to aggregate the logs for some reason -- with the previous solution a cat /var/log/foo.*/* would have been sufficient.

Solution 3:

As /var/log is non writable by users and if you don't want to keep the logs under their respective home directories, I would suggest using /var/tmp/foo.logs.uid which would be both writable by users and centralized.