在 php error_log 中使用 syslog 工具 [英] Using syslog facilities with php error_log

查看:33
本文介绍了在 php error_log 中使用 syslog 工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 php error_log 指令中或以其他方式在系统/服务器端使用 syslog facilities?

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

有点像……

error_log = syslog:local4
error_log = syslog(LOG_LOCAL4)

使用 php fpm 我可以在 fpm conf 中使用 syslog.facility 指令进行设置,但是 php 呢cli?

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

谢谢

推荐答案

Php 默认 syslog 的工具是user"(并且不能更改)

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

我在 phi.ini 中使用指令 auto_prepend_file(此脚本必须在 include_path 下)

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

auto_prepend_file = log.php

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

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

这篇关于在 php error_log 中使用 syslog 工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆