Avoid setuid if at all possible since it is easy to screw up and give
root permissions away. You generally don't need this for logging
secretly anyway. I suggest you create your log file with 0600 permissions so only
you (and root) can read it. Another way -- use syslog instead
and setup your syslogd to send your entries to your own
special file that only root can get to.
Thanks for the advice, however I don't think that will work. Syslogd doesn't give me the control that I desire on the message style and your first suggestion 0600 wouldn't work because I have a ton of users that will be running a bunch of scripts and all of them need to have logging functionality. So my original question still stands, do you know how to use setuid with modules?
Thanks!