Forum Moderators: coopster
I am trying to keep local0.info in my log. But other processes using local0.notice are keeping its entries in my log too. Could anybody give me an idea to fix it? ( my OS is solaris )
Here is my syslog function.
function logger($uname)
{
define_syslog_variables();
openlog("MailRCPT",LOG_PID ¦ LOG_PERROR, LOG_LOCAL0);
syslog(LOG_INFO, " $_SERVER[REMOTE_ADDR] $uname");
closelog();
}
In syslog.conf, I wrote this.
local0.info /my/dir/log/mylog.log
I see some issues
logs are done by levels and info is the absolute lowest aside from debug so that would also include
EMERG, ALERT, CRIT, ERR, WARNING, NOTICE and of course INFO
this is a situation specific to Solaris, other systems would have just info messages going to a LOCAL0.info
you are also using the option LOG_PERROR so this will also copy to standard error which is usually located in /var/adm/messages. I don't know if that is your intention or not, just mentioning it.
I am also wondering why it seems you are logging mail, not that it matters, just struck me. mail logs might work as well.
I would suggest playing with the levels or just using a different LOCAL for these particular messages.
Thank you so much for your reply. LOG_PERROR is unintentionally used here and I drop this. I am just trying to keep log entries for every user who access my system. ( not mail log, just for administrative purporse ) To avoid other processes' log entries, how can I implement different LOCAL? Could you please give me some hints?
regards,
Mitchell