File: openlog.xml

package info (click to toggle)
php-doc 20140201-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 74,084 kB
  • ctags: 4,040
  • sloc: xml: 998,137; php: 20,812; cpp: 500; sh: 177; makefile: 63; awk: 28
file content (219 lines) | stat: -rw-r--r-- 6,799 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 297028 $ -->
<refentry xml:id="function.openlog" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>openlog</refname>
  <refpurpose>Open connection to system logger</refpurpose>
 </refnamediv>
 
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>bool</type><methodname>openlog</methodname>
   <methodparam><type>string</type><parameter>ident</parameter></methodparam>
   <methodparam><type>int</type><parameter>option</parameter></methodparam>
   <methodparam><type>int</type><parameter>facility</parameter></methodparam>
  </methodsynopsis>
  <para>
   <function>openlog</function> opens a connection to the system
   logger for a program.  
  </para>
  <para> 
   The use of <function>openlog</function> is optional. It
   will automatically be called by <function>syslog</function> if
   necessary, in which case <parameter>ident</parameter> will default
   to &false;.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>ident</parameter></term>
     <listitem>
      <para>
       The string <parameter>ident</parameter> is added to each message. 
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>option</parameter></term>
     <listitem>
      <para>
       The <parameter>option</parameter> argument is used to indicate
       what logging options will be used when generating a log message.
       <table>
        <title><function>openlog</function> Options</title>
        <tgroup cols="2">
         <thead>
          <row>
           <entry>Constant</entry>
           <entry>Description</entry>
          </row>
         </thead>
         <tbody>
          <row>
           <entry><constant>LOG_CONS</constant></entry>
           <entry>
            if there is an error while sending data to the system logger,
            write directly to the system console
           </entry>
          </row>
          <row>
           <entry><constant>LOG_NDELAY</constant></entry>
           <entry>
            open the connection to the logger immediately
           </entry>
          </row>
          <row>
           <entry><constant>LOG_ODELAY</constant></entry>
           <entry>
            (default) delay opening the connection until the first
            message is logged
           </entry>
          </row>
          <row>
           <entry><constant>LOG_PERROR</constant></entry>
           <entry>print log message also to standard error</entry>
          </row>
          <row>
           <entry><constant>LOG_PID</constant></entry>
           <entry>include PID with each message</entry>
          </row>
         </tbody>
        </tgroup>
       </table>
       You can use one or more of this options. When using multiple options
       you need to <literal>OR</literal> them, i.e. to open the connection
       immediately, write to the console and include the PID in each message,
       you will use: <literal>LOG_CONS | LOG_NDELAY | LOG_PID</literal>
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>facility</parameter></term>
     <listitem>
      <para>
       The <parameter>facility</parameter> 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.
       <table>
        <title><function>openlog</function> Facilities</title>
        <tgroup cols="2">
         <thead>
          <row>
           <entry>Constant</entry>
           <entry>Description</entry>
          </row>
         </thead>
         <tbody>
          <row>
           <entry><constant>LOG_AUTH</constant></entry>
           <entry>
            security/authorization messages (use 
            <constant>LOG_AUTHPRIV</constant> instead
            in systems where that constant is defined)
           </entry>
          </row>
          <row>
           <entry><constant>LOG_AUTHPRIV</constant></entry>
           <entry>security/authorization messages (private)</entry>
          </row>
          <row>
           <entry><constant>LOG_CRON</constant></entry>
           <entry>clock daemon (cron and at)</entry>
          </row>
          <row>
           <entry><constant>LOG_DAEMON</constant></entry>
           <entry>other system daemons</entry>
          </row>
          <row>
           <entry><constant>LOG_KERN</constant></entry>
           <entry>kernel messages</entry>
          </row>
          <row>
           <entry><constant>LOG_LOCAL0</constant> ... <constant>LOG_LOCAL7</constant></entry>
           <entry>reserved for local use, these are not available in Windows</entry>
          </row>
          <row>
           <entry><constant>LOG_LPR</constant></entry>
           <entry>line printer subsystem</entry>
          </row>
          <row>
           <entry><constant>LOG_MAIL</constant></entry>
           <entry>mail subsystem</entry>
          </row>
          <row>
           <entry><constant>LOG_NEWS</constant></entry>
           <entry>USENET news subsystem</entry>
          </row>
          <row>
           <entry><constant>LOG_SYSLOG</constant></entry>
           <entry>messages generated internally by syslogd</entry>
          </row>
          <row>
           <entry><constant>LOG_USER</constant></entry>
           <entry>generic user-level messages</entry>
          </row>
          <row>
           <entry><constant>LOG_UUCP</constant></entry>
           <entry>UUCP subsystem</entry>
          </row>
         </tbody>
        </tgroup>
       </table>
      </para>
      <note>
       <para>
        <constant>LOG_USER</constant> is the only valid log type under Windows
        operating systems
       </para>
      </note>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   &return.success;
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>syslog</function></member>
    <member><function>closelog</function></member>
   </simplelist>
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->