Hmmm... it's useless. I finally took the time to make some tests, it
seems to be "impossible" to make PHP's syslog-calls fail. I changed
permissions on /dev/log, I removed the device node - openlog() and
syslog() always give back (boolean)true.

Curious I also tried it from command line by calling /usr/bin/logger,
the result was the same. Even if logger fails it gives me no error,
see this strace snipplet as an example:

> # strace logger test && echo "OK"
> ...
> connect(1, {sa_family=AF_FILE, path="/dev/log"}, 16) = -1 ENOENT
>  (No such file or directory)
> close(1)                                = 0
> exit_group(0)                           = ?
> Process 4733 detached
> OK

So what would you suggest? Remove my tests for syslog() and openlog()
return values from my Zend_Log_Writer_Syslog proposal? Or just leave
them as they are? Can someone test behaviour on Windows 2003 R2? Are
PHP's syslog functions aware of failing syslog calls on those systems?

Kind regards,
Thomas Gelf

NB: I did all tests on Debian Etch and Debian Lenny, 64bit systems.


Matthew Ratzloff schrieb:
Manually change the permissions for syslog on your local machine, make the test fail, change the permissions to be correct and make sure the test succeeds. Maybe log something then strpos the contents of tail. That's all you can really do.

-Matt
>
> I could achieve this by removing or changing permissions on /dev/log,
> no idea about Windows. But I've some doubt if doing so would make
> people running the tests happy :p
>
> Regards,
> Thomas

Reply via email to