openlog Open connection to system logger
发表日期:2021-07-01 08:56:42 | 来源: | | 浏览(920) 分类:网络 函数
openlog
(PHP 4, PHP 5, PHP 7, PHP 8)
openlog — Open connection to system logger
说明
$prefix
, int $flags
, int $facility
): boolopenlog() opens a connection to the system logger for a program.
The use of openlog() is optional. It
will automatically be called by syslog() if
necessary, in which case prefix
will default
to false
.
参数
-
prefix
-
The string
prefix
is added to each message. -
flags
-
The
flags
argument is used to indicate what logging options will be used when generating a log message.openlog() Options Constant Description LOG_CONS
if there is an error while sending data to the system logger, write directly to the system console LOG_NDELAY
open the connection to the logger immediately LOG_ODELAY
(default) delay opening the connection until the first message is logged LOG_PERROR
print log message also to standard error LOG_PID
include PID with each message OR
them, i.e. to open the connection immediately, write to the console and include the PID in each message, you will use:LOG_CONS | LOG_NDELAY | LOG_PID
-
facility
-
The
facility
argument is used to specify what type of program is logging the message. This allows you to specify (in your machine's syslog configuration) how messages coming from different facilities will be handled.openlog() Facilities Constant Description LOG_AUTH
security/authorization messages (use LOG_AUTHPRIV
instead in systems where that constant is defined)LOG_AUTHPRIV
security/authorization messages (private) LOG_CRON
clock daemon (cron and at) LOG_DAEMON
other system daemons LOG_KERN
kernel messages LOG_LOCAL0
...LOG_LOCAL7
reserved for local use, these are not available in Windows LOG_LPR
line printer subsystem LOG_MAIL
mail subsystem LOG_NEWS
USENET news subsystem LOG_SYSLOG
messages generated internally by syslogd LOG_USER
generic user-level messages LOG_UUCP
UUCP subsystem 注意:
LOG_USER
is the only valid log type under Windows operating systems
返回值
成功时返回 true
, 或者在失败时返回 false
。
- PHP(0)
- PHP杂项(34)
- PHP基础-李炎恢系列课程(20)
- 中文函数手册(0)
- 错误处理 函数(13)
- OPcache 函数(6)
- PHP 选项/信息 函数(54)
- Zip 函数(10)
- Hash 函数(15)
- OpenSSL 函数(63)
- Date/Time 函数(51)
- 目录函数(9)
- Fileinfo 函数(6)
- iconv 函数(11)
- 文件系统函数(81)
- 多字节字符串 函数(57)
- GD 和图像处理 函数(114)
- 可交换图像信息(5)
- Math 函数(50)
- 程序执行函数(11)
- PCNTL 函数(23)
- JSON 函数(4)
- SPL 函数(15)
- URL 函数(10)
- cURL 函数(32)
- 网络 函数(33)
- checkdnsrr 给指定的主机(域名)或者IP地址做DNS通信检查(0)
- closelog 关闭系统日志链接(0)
- dns_check_record 别名 checkdnsrr()(0)
- dns_get_mx 别名 getmxrr()(0)
- dns_get_record 获取指定主机的DNS记录(0)
- fsockopen 打开一个网络连接或者一个Unix套接字连接(0)
- gethostbyaddr 获取指定的IP地址对应的主机名(0)
- gethostbyname 返回主机名对应的 IPv4地址。(0)
- gethostbynamel 获取互联网主机名对应的 IPv4 地址列表(0)
- gethostname 获取主机名(0)
- getmxrr 获取互联网主机名对应的 MX 记录(0)
- getprotobyname Get protocol number associated with protocol name(0)
- getprotobynumber Get protocol name associated with protocol number(0)
- getservbyname 获取互联网服务协议对应的端口(0)
- getservbyport Get Internet service which corresponds to port and protocol(0)
- header_register_callback 调用一个 header 函数(0)
- header_remove 删除之前设置的 HTTP 头(0)
- header 发送原生 HTTP 头(0)
- headers_list 返回已发送的 HTTP 响应头(或准备发送的)(0)
- headers_sent 检测 HTTP 头是否已经发送(0)
- http_response_code 获取/设置响应的 HTTP 状态码(0)
- inet_ntop Converts a packed internet address to a human readable representation(0)
- inet_pton Converts a human readable IP address to its packed in_addr representation(0)
- ip2long 将 IPV4 的字符串互联网协议转换成长整型数字(0)
- long2ip 将长整型转化为字符串形式带点的互联网标准格式地址(IPV4)(0)
- openlog Open connection to system logger(0)
- pfsockopen 打开一个持久的网络连接或者Unix套接字连接。(0)
- setcookie 发送 Cookie(0)
- setrawcookie 发送未经 URL 编码的 cookie(0)
- socket_get_status 别名 stream_get_meta_data()(0)
- socket_set_blocking 别名 stream_set_blocking()(0)
- socket_set_timeout 别名 stream_set_timeout()(0)
- syslog Generate a system log message(0)
- FTP 函数(36)
- Session 函数(23)
- PCRE 函数(11)
- PCRE 正则语法(19)
- 数组 函数(81)
- 类/对象 函数(18)
- 函数处理 函数(13)
- 变量处理 函数(37)
- SimpleXML 函数(3)
- 杂项 函数(31)
- 字符串 函数(101)