Log to the php default log

I would like to write something to the same logging as php does (specified by the apache/nginx config). Can I use one of the logging adapter for that or should I fallback to the native php error_log() ?

edited Mar '16

You could use ini_get("error_log") like so:

$logger = new \Phalcon\Logger\Adapter\File(ini_get('error_log'));


The error_log of the ini_het is empty in my setup. Nginx is catching the errors and logs them in the right file. I assume it's using some standard output that nginx or apache graps. I tried StreamAdapter('php://stdout') but that wasn't working.

This might help, keep the stdout streamadapter:

; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Default Value: no
catch_workers_output = yes