What I Currently Have Working
I have written a python application which writes messages via rsyslog. I have configured rsyslog to write to a custom log file at /var/log/my_custom_log.log
where my entries are coming up fine.
My default syslog.conf
is unmodified. My /etc/rsyslog.d/00-myrules.conf
is as follows:
:msg, contains, "Transmission" /var/log/transmission.log
& ~
I also don't understand what the & ~ at the end does, but it seems to not work without it.
What I Need To Work
All I want is to be able to write logs to /home/me/logs/my_tests.log
. When I am testing my application, I need to ensure certain things are being written to the log a certain number of times. What I was doing before was writing my messages to a plain text file in my home directory, checking to see if this file was correct, then deleting it for each and every test. I now need to do the same thing but with rsyslog. I am running my tests as my user.
I want the normal logs to write to /var/log/my_app_log.log
, that's fine.
What I Have Tried
- This user seems to have had the same issue I am, but I am not understanding either the accepted answer (I don't understand what SElinux has to do with it, how it may be influencing anything, or what or where these labels are that they are talking about), or the other one (the user mentions doing something not recommended for security reasons, which I should avoid but I don't understand where to run this command even if I wanted to).
- This user's issue turned out to be a matter of who owned the directory, but if I run
ps aux | grep "rsyslog"
, it returns that/usr/sbin/rsyslogd -n
is running under root, which (correct me if I'm wrong here) should be able to write to subdirectories my home directory, regardless of who owns it.