简体   繁体   中英

Using syslog facilities with php error_log

Is posible use syslog facilities in php error_log directive or in other way at system/server side?

Something like...

error_log = syslog:local4
error_log = syslog(LOG_LOCAL4)

Using php fpm I can set this with syslog.facility directive in fpm conf, but what about of php cli?

Thanks

Php default syslog's facility is "user" (and cannot be changed)

I use directive auto_prepend_file in phi.ini (this script must be under include_path)

auto_prepend_file = log.php

and

root@sp:/etc/php5/cli# cat /usr/share/php5/log.php
<?php

openlog('php-cli', 0, LOG_LOCAL4);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM