Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i am working on Ubuntu, (it use rsyslog), and i need to custom log some info with PHP. Here is my code:

openlog("mywebsite", LOG_PID | LOG_PERROR, LOG_LOCAL2);
syslog(LOG_WARNING, "mywebsite: 1000th visitor !");

and i defined in /etc/rsyslog/rsyslog.d/50-default.conf :

local2.*            /var/log/apache2/mywebsite.log

the file mywebsite is defined chmod 777 but nothing appear in mywebsite.log but still in access.log

Does anonyone got an idea why ? Thanks in advance PS: i also done service rsyslog reload Have a nice day

share|improve this question
Also, i found that in error.log i got PHP Notice: Undefined variable: access in /var/www/default/public_html/index.php on line 6 It seems that LOG_LOCAL2' is not recognized by PHP despite it's defined in the offcial documentation. (I Also tried with LOG_LOCAL0') –  Pierre Lebon Jul 6 '13 at 21:57
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.