Skip to content

Commit 0ba946a

Browse files
committed
docbooks for definition
1 parent 38e646f commit 0ba946a

1 file changed

Lines changed: 85 additions & 59 deletions

File tree

syslog.class.php

Lines changed: 85 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
22
/**
3-
* Short description for file
4-
*
5-
* Long description for file (if any)...
3+
* The Syslog class is a syslog client implementation in PHP
4+
* following the RFC 3164, 5424, 5425, 5426 rules.
5+
* This class is compatible with PHP logger constants for serverity and facility.
6+
* Default value are UDP connection with RFC3164 mode
67
*
78
* PHP version 5
89
*
9-
* LICENSE: * Copyright 2013 Laurent Vromman
10+
* LICENSE:
1011
*
1112
* This program is free software: you can redistribute it and/or modify
1213
* it under the terms of the GNU LesserGeneral Public License as published by
@@ -30,37 +31,95 @@
3031
* @link http://pear.php.net/package/Net_Syslog
3132
*/
3233

33-
/*
34-
* Place includes, constant defines and $_GLOBAL settings here.
35-
* Make sure they have appropriate docblocks to avoid phpDocumentor
36-
* construing they are documented by the page-level docblock.
37-
*/
3834

35+
// {{{ constants
36+
37+
/**
38+
* Set default linux network interface
39+
*/
40+
define("NET_SYSLOG_LINUX_NETWORD_INTERFACE", "eth0");
41+
42+
/**
43+
* Set NILVALUE as defined in RFC 5424
44+
*/
45+
define("NET_SYSLOG_NILVALUE", "-");
46+
47+
/**
48+
* Add missing LOG_FTP level log to existing PHP log levels
49+
*/
50+
defined('LOG_FTP') or define("LOG_FTP", 88);
51+
52+
53+
/**
54+
* Add missing LOG_NTP level log to existing PHP log levels
55+
*/
56+
defined('LOG_NTP') or define("LOG_NTP", 96);
57+
58+
59+
/**
60+
* Add missing LOG_LOG_AUDIT level log to existing PHP log levels
61+
*/
62+
defined('LOG_LOG_AUDIT') or define("LOG_LOG_AUDIT", 104);
63+
64+
65+
/**
66+
* Add missing LOG_ALERT level log to existing PHP log levels
67+
*/
68+
defined('LOG_ALERT') or define("LOG_ALERT", 112);
69+
70+
71+
/**
72+
* Add missing LOG_CLOCK level log to existing PHP log levels
73+
*/
74+
defined('LOG_CLOCK') or define("LOG_CLOCK", 120);
75+
76+
/**
77+
* TCP connection mode
78+
*/
79+
define("NET_SYSLOG_TCP", "tcp");
80+
81+
/**
82+
* UDP connection mode
83+
*/
84+
define("NET_SYSLOG_UDP", "udp");
85+
86+
/**
87+
* SSL connection mode
88+
*/
89+
define("NET_SYSLOG_SSL", "ssl");
90+
91+
/**
92+
* TLS connection mode
93+
*/
94+
define("NET_SYSLOG_TLS", "tls");
95+
96+
/**
97+
* Compatibility for RFC 5424, 5425 and 5426
98+
*/
99+
define("NET_SYSLOG_RFC542X", 1);
100+
101+
/**
102+
* Compatibility for RFC 3164
103+
*/
104+
define("NET_SYSLOG_RFC3164", 0);
105+
// }}}
39106

40107
/**
41-
*
42-
* Description
43-
*
44-
* The Syslog class is a syslog client implementation in PHP
45-
* following the RFC 3164, 5424, 5425, 5426 rules.
46-
* This class is compatible with PHP logger constants for serverity and facility.
47-
*
48-
* Default value are UDP connection with RFC3164 mode.
49108
*
50109
* Facility values:
51110
* LOG_KERN kernel messages
52111
* LOG_USER user-level messages
53112
* LOG_MAIL mail system
54-
* LOG_DAEMON system daemons
113+
* LOG_DAEMON system daemons
55114
* LOG_AUTH security/authorization messages
56115
* LOG_SYSLOG messages generated internally by syslogd
57-
* LOG_LPR line printer subsystem
116+
* LOG_LPR line printer subsystem
58117
* LOG_NEWS network news subsystem
59118
* LOG_UUCP UUCP subsystem
60119
* LOG_CRON clock daemon
61120
* LOG_AUTHPRIV security/authorization messages
62121
* LOG_FTP FTP daemon
63-
* LOG_NTP NTP subsystem
122+
* LOG_NTP NTP subsystem
64123
* LOG_AUDIT log audit
65124
* LOG_LOG_ALERT log alert
66125
* LOG_CLOCK clock daemon
@@ -77,17 +136,17 @@
77136
* LOG_EMERG Emergency: system is unusable
78137
* LOG_ALERT Alert: action must be taken immediately
79138
* LOG_CRIT Critical: critical conditions
80-
* LOG_ERR Error: error conditions
81-
* LOG_WARNING Warning: warning conditions
139+
* LOG_ERR Error: error conditions
140+
* LOG_WARNING Warning: warning conditions
82141
* LOG_NOTICE Notice: normal but significant condition (default value)
83142
* LOG_INFO Informational: informational messages
84143
* LOG_DEBUG Debug: debug-level messages
85144
*
86145
* Protocols:
87-
* SYSLOG_UDP udp protocol. Defaut behaviour
88-
* SYSLOG_TCP tcp protocol
89-
* SYSLOG_SSL ssl protocol. CA File can optionnaly be set
90-
* SYSLOG_TLS tls protocol
146+
* NET_SYSLOG_UDP udp protocol. Defaut behaviour
147+
* NET_SYSLOG_TCP tcp protocol
148+
* NET_SYSLOG_SSL ssl protocol. CA File can optionnaly be set
149+
* NET_SYSLOG_TLS tls protocol
91150
*
92151
*
93152
* Usage
@@ -141,44 +200,11 @@
141200
* * In Windows, PHP Sockets can be activated by un-commenting
142201
* extension=php_sockets.dll in php.ini
143202
*
144-
* Licence
145-
*
146-
* Copyright 2013 Laurent Vromman
147-
*
148-
* This program is free software: you can redistribute it and/or modify
149-
* it under the terms of the GNU LesserGeneral Public License as published by
150-
* the Free Software Foundation, either version 3 of the License, or
151-
* (at your option) any later version.
152-
*
153-
* This program is distributed in the hope that it will be useful,
154-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
155-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
156-
* GNU Lesser General Public License for more details.
157-
*
158-
* You should have received a copy of the GNU General Public License
159-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
160203
*
161204
* TODO : RFC 5848, RFC 6587, Permanent socket
162205
*
163206
*/
164207

165-
define("NET_SYSLOG_LINUX_NETWORD_INTERFACE", "eth0");
166-
define("NET_SYSLOG_NILVALUE", "-");
167-
168-
define("LOG_FTP", 88);
169-
define("LOG_NTP", 96);
170-
define("LOG_LOG_AUDIT", 104);
171-
define("LOG_ALERT", 112);
172-
define("LOG_CLOCK", 120);
173-
174-
define("NET_SYSLOG_TCP", "tcp");
175-
define("NET_SYSLOG_UDP", "udp");
176-
define("NET_SYSLOG_SSL", "ssl");
177-
define("NET_SYSLOG_TLS", "tls");
178-
// Compatibility for RFC 5424, 5425 and 5426
179-
define("NET_SYSLOG_RFC542X", 1);
180-
define("NET_SYSLOG_RFC3164", 0);
181-
182208
/**
183209
* Short description for class
184210
*

0 commit comments

Comments
 (0)