I was trying to setup ZoneMinder to send logs to /var/log/zm/ in individual log files so that I could track it outside of syslog. Anyway, I noticed that when I enabled the "component logs" option in the Logging options of the web console, that the API would no longer authenticate properly. zmNinja would no longer work, and when I went to myserver/zm/api/ there was just a CakePHP error page. I checked my apache error logs with tail after loading the page, and found this.
Code: Select all
PHP Warning: file_put_contents(/var/log/zmerror.log) [<a href='http://php.net/function.file-put-contents'>function.file-put-contents</a>]: failed to open stream: Permission denied in /usr/share/zoneminder/www/api/lib/Cake/Log/Engine/FileLog.php on line 142
I'm not sure why it was doing this, as the /var/log/zm/ directory had proper permissions and ownership, and all the logging components were writing successfully.
At any rate, I decided I didn't need the logging to /var/log/zm/ afterall, but thought I should still bring this to light. Once I changed it back to default logging, the API works fine again.