Like a good sysadmin, I’ve been lazy. But not in a good way.
Thus far, anyone on MyUnixHost.com has not been able to see their log files. Which hasn’t yet been a problem, so I hadn’t felt the need to solve it just yet.
Until tonight. Well, and some of yesterday too.
Yesterday, I wrote a program simply called ‘weblog’ that will output from the main apache log files the entries that belong to domains you own. You can either direct output to a file using ‘>’ or ‘>>’, or pipe it into ‘less’ or something.
Today, I wrote a script that splits yesterday’s log file by domain using ‘split-logfile’, and then moves those files into /www/<YOUR_USER_NAME/logs.
I then wrote a logrotate conf file to rotate these logs on a daily basis, and keep the last 7 days. You are of course free to remove them if you’d like.
It keeps getting better and better!