Skip to content

Commit 0201d7b

Browse files
committed
Comment update
1 parent 0ba946a commit 0201d7b

1 file changed

Lines changed: 99 additions & 101 deletions

File tree

syslog.class.php

Lines changed: 99 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,105 @@
44
* following the RFC 3164, 5424, 5425, 5426 rules.
55
* This class is compatible with PHP logger constants for serverity and facility.
66
* Default value are UDP connection with RFC3164 mode
7+
*
8+
* Facility values:
9+
* LOG_KERN kernel messages
10+
* LOG_USER user-level messages
11+
* LOG_MAIL mail system
12+
* LOG_DAEMON system daemons
13+
* LOG_AUTH security/authorization messages
14+
* LOG_SYSLOG messages generated internally by syslogd
15+
* LOG_LPR line printer subsystem
16+
* LOG_NEWS network news subsystem
17+
* LOG_UUCP UUCP subsystem
18+
* LOG_CRON clock daemon
19+
* LOG_AUTHPRIV security/authorization messages
20+
* LOG_FTP FTP daemon
21+
* LOG_NTP NTP subsystem
22+
* LOG_AUDIT log audit
23+
* LOG_LOG_ALERT log alert
24+
* LOG_CLOCK clock daemon
25+
* LOG_LOCAL0 local user 0 (local0) (default value)
26+
* LOG_LOCAL1 local user 1 (local1)
27+
* LOG_LOCAL2 local user 2 (local2)
28+
* LOG_LOCAL3 local user 3 (local3)
29+
* LOG_LOCAL4 local user 4 (local4)
30+
* LOG_LOCAL5 local user 5 (local5)
31+
* LOG_LOCAL6 local user 6 (local6)
32+
* LOG_LOCAL7 local user 7 (local7)
33+
*
34+
* Severity values:
35+
* LOG_EMERG Emergency: system is unusable
36+
* LOG_ALERT Alert: action must be taken immediately
37+
* LOG_CRIT Critical: critical conditions
38+
* LOG_ERR Error: error conditions
39+
* LOG_WARNING Warning: warning conditions
40+
* LOG_NOTICE Notice: normal but significant condition (default value)
41+
* LOG_INFO Informational: informational messages
42+
* LOG_DEBUG Debug: debug-level messages
43+
*
44+
* Protocols:
45+
* NET_SYSLOG_UDP udp protocol. Defaut behaviour
46+
* NET_SYSLOG_TCP tcp protocol
47+
* NET_SYSLOG_SSL ssl protocol. CA File can optionnaly be set
48+
* NET_SYSLOG_TLS tls protocol
49+
*
50+
*
51+
* Usage
52+
*
53+
* require_once('syslog.class.php');
54+
* $syslog = new Net_Syslog($hostname = "", $appname = NET_SYSLOG_NILVALUE, $protocol = NET_SYSLOG_UDP,
55+
* $_procid = NET_SYSLOG_NILVALUE);
56+
* $syslog->logger($priority = LOG_LOCAL0 + LOG_NOTICE, $content = "");
57+
* or
58+
* $syslog->logger542X($priority = 133, $content = "Default content", $msgid = NET_SYSLOG_NILVALUE,
59+
* $structured_data = NET_SYSLOG_NILVALUE);
60+
* or
61+
* $syslog->logger3164($priority = 133, $content = "Default content");
62+
*
63+
* Examples
64+
*
65+
* Example 1
66+
*
67+
* require_once('syslog.class.php');
68+
* $syslog = new Net_Syslog();
69+
* $syslog->logger(LOG_LOCAL0 + LOG_NOTICE, 'Syslog message');
70+
*
71+
*
72+
* Example 2
73+
*
74+
* require_once('syslog.class.php');
75+
* $syslog = new Net_Syslog('myserver', 'MyApp', NET_SYSLOG_TCP);
76+
* $syslog->logger(LOG_LOCAL0 + LOG_NOTICE, 'Syslog message');
77+
*
78+
*
79+
* Example 3
80+
*
81+
* require_once('syslog.class.php');
82+
* $syslog = new Net_Syslog();
83+
* $syslog->setHostname('myserver');
84+
* $syslog->setRFC(NET_SYSLOG_RFC542X);
85+
* $syslog->setAppname('MyApp');
86+
* $syslog->setServer('192.168.0.12');
87+
* $syslog->logger(LOG_LOCAL0 + LOG_NOTICE, 'Syslog message');
88+
*
89+
* Example 4
90+
*
91+
* require_once('syslog.class.php');
92+
* $syslog = new Net_Syslog("myserver", "MyApp", NET_SYSLOG_SSL);
93+
* $syslog->setCAFile("ca.crt");
94+
* $syslog->logger(LOG_CRON + LOG_NOTICE, "Syslog message");
95+
*
96+
* Prerequisites
97+
*
98+
* - Sockets support must be enabled.
99+
* * In Linux and *nix environments, the extension is enabled at
100+
* compile time using the --enable-sockets configure option
101+
* * In Windows, PHP Sockets can be activated by un-commenting
102+
* extension=php_sockets.dll in php.ini
103+
*
104+
*
105+
* TODO : RFC 5848, RFC 6587, Permanent socket
7106
*
8107
* PHP version 5
9108
*
@@ -104,107 +203,6 @@
104203
define("NET_SYSLOG_RFC3164", 0);
105204
// }}}
106205

107-
/**
108-
*
109-
* Facility values:
110-
* LOG_KERN kernel messages
111-
* LOG_USER user-level messages
112-
* LOG_MAIL mail system
113-
* LOG_DAEMON system daemons
114-
* LOG_AUTH security/authorization messages
115-
* LOG_SYSLOG messages generated internally by syslogd
116-
* LOG_LPR line printer subsystem
117-
* LOG_NEWS network news subsystem
118-
* LOG_UUCP UUCP subsystem
119-
* LOG_CRON clock daemon
120-
* LOG_AUTHPRIV security/authorization messages
121-
* LOG_FTP FTP daemon
122-
* LOG_NTP NTP subsystem
123-
* LOG_AUDIT log audit
124-
* LOG_LOG_ALERT log alert
125-
* LOG_CLOCK clock daemon
126-
* LOG_LOCAL0 local user 0 (local0) (default value)
127-
* LOG_LOCAL1 local user 1 (local1)
128-
* LOG_LOCAL2 local user 2 (local2)
129-
* LOG_LOCAL3 local user 3 (local3)
130-
* LOG_LOCAL4 local user 4 (local4)
131-
* LOG_LOCAL5 local user 5 (local5)
132-
* LOG_LOCAL6 local user 6 (local6)
133-
* LOG_LOCAL7 local user 7 (local7)
134-
*
135-
* Severity values:
136-
* LOG_EMERG Emergency: system is unusable
137-
* LOG_ALERT Alert: action must be taken immediately
138-
* LOG_CRIT Critical: critical conditions
139-
* LOG_ERR Error: error conditions
140-
* LOG_WARNING Warning: warning conditions
141-
* LOG_NOTICE Notice: normal but significant condition (default value)
142-
* LOG_INFO Informational: informational messages
143-
* LOG_DEBUG Debug: debug-level messages
144-
*
145-
* Protocols:
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
150-
*
151-
*
152-
* Usage
153-
*
154-
* require_once('syslog.class.php');
155-
* $syslog = new Syslog($hostname = "", $appname = LOG_NILVALUE, $protocol = SYSLOG_UDP, $_procid = LOG_NILVALUE);
156-
* $syslog->logger($priority = LOG_LOCAL0 + LOG_NOTICE, $content = "");
157-
* or
158-
* $syslog->logger542X($priority = 133, $content = "Default content", $msgid = "-", $structured_data = "-");
159-
* or
160-
* $syslog->logger3164($priority = 133, $content = "Default content");
161-
*
162-
* Examples
163-
*
164-
* Example 1
165-
*
166-
* require_once('syslog.class.php');
167-
* $syslog = new Syslog();
168-
* $syslog->logger(LOG_LOCAL0 + LOG_NOTICE, 'Syslog message');
169-
*
170-
*
171-
* Example 2
172-
*
173-
* require_once('syslog.class.php');
174-
* $syslog = new Syslog('myserver', 'MyApp', SYSLOG_TCP);
175-
* $syslog->logger(LOG_LOCAL0 + LOG_NOTICE, 'Syslog message');
176-
*
177-
*
178-
* Example 3
179-
*
180-
* require_once('syslog.class.php');
181-
* $syslog = new Syslog();
182-
* $syslog->setHostname('myserver');
183-
* $syslog->setRFC(SYSLOG_RFC542X);
184-
* $syslog->setAppname('MyApp');
185-
* $syslog->setServer('192.168.0.12');
186-
* $syslog->logger(LOG_LOCAL0 + LOG_NOTICE, 'Syslog message');
187-
*
188-
* Example 4
189-
*
190-
* require_once('syslog.class.php');
191-
* $syslog = new Syslog("myserver", "MyApp", SYSLOG_SSL);
192-
* $syslog->setCAFile("ca.crt");
193-
* $syslog->logger(LOG_CRON + LOG_NOTICE, "Syslog message");
194-
*
195-
* Prerequisites
196-
*
197-
* - Sockets support must be enabled.
198-
* * In Linux and *nix environments, the extension is enabled at
199-
* compile time using the --enable-sockets configure option
200-
* * In Windows, PHP Sockets can be activated by un-commenting
201-
* extension=php_sockets.dll in php.ini
202-
*
203-
*
204-
* TODO : RFC 5848, RFC 6587, Permanent socket
205-
*
206-
*/
207-
208206
/**
209207
* Short description for class
210208
*

0 commit comments

Comments
 (0)