blob: ee6c84ff242b163b1bfaa8a7842a7bef5a969e14 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Apache Maven Doxia at Oct 13, 2012 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Apache log4php -
LoggerAppenderSyslog - Apache log4php</title>
<link rel="stylesheet" href="../../css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="../../css/site.css" type="text/css" />
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../js/prettify.min.js"></script>
<script type="text/javascript" src="../../js/site.js"></script>
<meta name="Date-Revision-yyyymmdd" content="20121013" />
<meta http-equiv="Content-Language" content="en" />
<!-- Google Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26177991-1']);
_gaq.push (['_gat._anonymizeIp']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="composite">
<div class="navbar">
<div class="navbar-inner">
<div class="container-fluid">
<a class="brand" href="http://logging.apache.org/log4php">Apache log4php &trade;</a>
<ul class="nav">
<li>
<a href="../../index.html" title="About">About</a>
</li>
<li>
<a href="../../download.html" title="Download">Download</a>
</li>
<li>
<a href="../../install.html" title="Install">Install</a>
</li>
<li>
<a href="../../quickstart.html" title="Quick start">Quick start</a>
</li>
</ul>
<!-- Twitter link -->
<ul class="nav pull-right">
<li><a href="http://twitter.com/log4php/" class="external">Follow <strong>@log4php</strong></a></li>
</ul>
<!-- Google CSE Search Box -->
<form class="navbar-search pull-right" id="cref" action="http://www.google.com/cse">
<input type="hidden" name="cref" value="http://logging.apache.org/log4php/cse.xml" />
<input class="search-query pull-left" type="text" name="q" size="40" placeholder="Search" />
</form>
</div>
</div>
</div>
<div class="container-fluid">
<table class="layout-table">
<tr>
<td class="sidebar">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-home"></i>Apache log4php™</li>
<li class="none">
<a href="../../index.html" title="About">About</a>
</li>
<li class="none">
<a href="../../download.html" title="Download">Download</a>
</li>
<li class="none">
<a href="../../install.html" title="Install">Install</a>
</li>
<li class="none">
<a href="../../changelog.html" title="Changelog">Changelog</a>
</li>
</ul>
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-book"></i>Documentation</li>
<li class="none">
<a href="../../quickstart.html" title="Quick start">Quick start</a>
</li>
<li class="none">
<a href="../../docs/introduction.html" title="Introduction">Introduction</a>
</li>
<li class="none">
<a href="../../docs/configuration.html" title="Configuration">Configuration</a>
</li>
<li class="none">
<a href="../../docs/loggers.html" title="Loggers">Loggers</a>
</li>
<li class="expanded">
<a href="../../docs/appenders.html" title="Appenders">Appenders</a>
<ul>
<li class="none">
<a href="../../docs/appenders/console.html" title="LoggerAppenderConsole">LoggerAppenderConsole</a>
</li>
<li class="none">
<a href="../../docs/appenders/daily-file.html" title="LoggerAppenderDailyFile">LoggerAppenderDailyFile</a>
</li>
<li class="none">
<a href="../../docs/appenders/echo.html" title="LoggerAppenderEcho">LoggerAppenderEcho</a>
</li>
<li class="none">
<a href="../../docs/appenders/file.html" title="LoggerAppenderFile">LoggerAppenderFile</a>
</li>
<li class="none">
<a href="../../docs/appenders/firephp.html" title="LoggerAppenderFirePHP">LoggerAppenderFirePHP</a>
</li>
<li class="none">
<a href="../../docs/appenders/mail.html" title="LoggerAppenderMail">LoggerAppenderMail</a>
</li>
<li class="none">
<a href="../../docs/appenders/mail-event.html" title="LoggerAppenderMailEvent">LoggerAppenderMailEvent</a>
</li>
<li class="none">
<a href="../../docs/appenders/mongodb.html" title="LoggerAppenderMongoDB">LoggerAppenderMongoDB</a>
</li>
<li class="none">
<a href="../../docs/appenders/null.html" title="LoggerAppenderNull">LoggerAppenderNull</a>
</li>
<li class="none">
<a href="../../docs/appenders/pdo.html" title="LoggerAppenderPDO">LoggerAppenderPDO</a>
</li>
<li class="none">
<a href="../../docs/appenders/php.html" title="LoggerAppenderPHP">LoggerAppenderPHP</a>
</li>
<li class="none">
<a href="../../docs/appenders/rolling-file.html" title="LoggerAppenderRollingFile">LoggerAppenderRollingFile</a>
</li>
<li class="none">
<a href="../../docs/appenders/socket.html" title="LoggerAppenderSocket">LoggerAppenderSocket</a>
</li>
<li class="none active">
<a href="../../docs/appenders/syslog.html" title="LoggerAppenderSyslog">LoggerAppenderSyslog</a>
</li>
</ul>
</li>
<li class="collapsed">
<a href="../../docs/layouts.html" title="Layouts">Layouts</a>
</li>
<li class="none">
<a href="../../docs/filters.html" title="Filters">Filters</a>
</li>
<li class="none">
<a href="../../docs/renderers.html" title="Renderers">Renderers</a>
</li>
<li class="none">
<a href="../../apidocs/index.html" title="API documentation">API documentation</a>
</li>
</ul>
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-user"></i>Community</li>
<li class="none">
<a href="../../volunteering.html" title="Volunteering">Volunteering</a>
</li>
<li class="none">
<a href="../../contributingpatches.html" title="Contributing Patches">Contributing Patches</a>
</li>
<li class="none">
<a href="http://wiki.apache.org/logging-log4php" class="external" target="_blank" title="Wiki">Wiki</a>
</li>
<li class="none">
<a href="http://blogs.apache.org/logging/" class="external" target="_blank" title="Blog">Blog</a>
</li>
</ul>
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-info-sign"></i>Project Information</li>
<li class="none">
<a href="../../integration.html" title="Continuous Integration">Continuous Integration</a>
</li>
<li class="none">
<a href="../../source-repository.html" title="Source Repository">Source Repository</a>
</li>
<li class="none">
<a href="../../dependencies.html" title="Dependencies">Dependencies</a>
</li>
<li class="none">
<a href="../../license.html" title="Project License">Project License</a>
</li>
<li class="none">
<a href="../../team-list.html" title="Project Team">Project Team</a>
</li>
<li class="none">
<a href="../../issue-tracking.html" title="Issue Tracking">Issue Tracking</a>
</li>
<li class="none">
<a href="../../mail-lists.html" title="Mailing Lists">Mailing Lists</a>
</li>
</ul>
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-cog"></i>Project Reports</li>
<li class="none">
<a href="../../changes-report.html" title="Changes Report">Changes Report</a>
</li>
<li class="none">
<a href="../../surefire-report.html" title="Surefire Report">Surefire Report</a>
</li>
<li class="none">
<a href="../../rat-report.html" title="RAT Report">RAT Report</a>
</li>
<li class="none">
<a href="../../coverage-report/index.html" title="Code Coverage">Code Coverage</a>
</li>
</ul>
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-heart"></i>Apache</li>
<li class="none">
<a href="http://www.apache.org" class="external" target="_blank" title="Home">Home</a>
</li>
<li class="none">
<a href="http://www.apache.org/foundation/sponsorship.html" class="external" target="_blank" title="Sponsorship">Sponsorship</a>
</li>
<li class="none">
<a href="http://www.apache.org/licenses/" class="external" target="_blank" title="License">License</a>
</li>
<li class="none">
<a href="http://www.apache.org/foundation/thanks.html" class="external" target="_blank" title="Thanks">Thanks</a>
</li>
<li class="none">
<a href="http://www.apachecon.com" class="external" target="_blank" title="Conferences">Conferences</a>
</li>
<li class="none">
<a href="http://www.apache.org/security/" class="external" target="_blank" title="Security">Security</a>
</li>
</ul>
</div>
<div id="poweredBy">
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="poweredBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" />
</a>
</div>
</td>
<td class="content">
<!-- Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. -->
<div class="section"><h2>LoggerAppenderSyslog<a name="LoggerAppenderSyslog"></a></h2>
<p><tt>LoggerAppenderSyslog</tt> logs events to the syslog.</p>
<div class="section"><h3>Layout<a name="Layout"></a></h3>
<p>This appender requires a layout. If no layout is specified in configuration,
<tt><a href="../layouts/simple.html">LoggerLayoutSimple</a></tt> will be used by default.</p>
</div>
<div class="section"><h3>Parameters<a name="Parameters"></a></h3>
<p>The following parameters are available:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>ident</td>
<td>string</td>
<td>no</td>
<td>Apache log4php</td>
<td>A string which will identify your appender.</td>
</tr>
<tr class="a">
<td>overridePriority</td>
<td>boolean</td>
<td>No</td>
<td>false</td>
<td>If set to true, all messages will be sent to the syslog using the priority specified
in the <tt>priority</tt> parameter. Otherwise, the pririty will depend on the level
of the event being logged. See below.</td>
</tr>
<tr class="b">
<td>priority</td>
<td>string</td>
<td>Yes/No</td>
<td>-</td>
<td>The syslog priority to use when overriding priority. This setting is required if
<tt>overridePriority</tt> is set to true. <a href="#Priorities">See below</a> for
available priorities.</td>
</tr>
<tr class="a">
<td>facility</td>
<td>string</td>
<td>No</td>
<td><tt>USER</tt></td>
<td>The syslog facility. Identifies the part of the system from which the event originated.
<a href="#Facilities">See below</a> for available facilities.</td>
</tr>
<tr class="b">
<td>option</td>
<td>string</td>
<td>No</td>
<td><tt>PID|CONS</tt></td>
<td>Syslog options. <a href="#Options">See below</a> for available options.</td>
</tr>
</tbody>
</table>
</div>
<a name="Priorities"></a><div class="section" id="Priorities"><h3>Priorities<a name="Priorities"></a></h3>
<p>The <i>priority</i> is the syslog equivalent of the log4php level. Here's a list of priorities
available in syslog and the equivalent log4php levels.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th>Priority</th>
<th>Description</th>
<th>Equivalent level</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>EMERG</td>
<td>System is unusable.</td>
<td>-</td>
</tr>
<tr class="a">
<td>ALERT</td>
<td>Action must be taken immediately.</td>
<td>FATAL</td>
</tr>
<tr class="b">
<td>CRIT</td>
<td>Critical conditions.</td>
<td>-</td>
</tr>
<tr class="a">
<td>ERR</td>
<td>Error conditions.</td>
<td>ERROR</td>
</tr>
<tr class="b">
<td>WARNING</td>
<td>Warning conditions</td>
<td>WARN</td>
</tr>
<tr class="a">
<td>NOTICE</td>
<td>Normal, but significant, condition</td>
<td>-</td>
</tr>
<tr class="b">
<td>INFO</td>
<td>Informational message</td>
<td>INFO</td>
</tr>
<tr class="a">
<td>DEBUG</td>
<td>Debug-level message</td>
<td>DEBUG, TRACE</td>
</tr>
</tbody>
</table>
<p>Messages with level <tt>FATAL</tt> will be logged using the syslog's <tt>ALERT</tt> priority;
<tt>ERROR</tt> level message will use <tt>ERR</tt> priority, etc.</p>
<p>Note that there is no priority below <tt>DEBUG</tt>, therefore both <tt>TRACE</tt> and
<tt>DEBUG</tt> level mesages will be logged using the <tt>DEBUG</tt> syslog priority.</p>
</div>
<a name="Facilities"></a><div class="section" id="Facilities"><h3>Facilities<a name="Facilities"></a></h3>
<p>The <i>facility</i> parameter 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.</p>
<p>The following facilities are available:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>KERN</td>
<td>Kernel messages</td>
</tr>
<tr class="a">
<td>USER</td>
<td>Generic user-level messages</td>
</tr>
<tr class="b">
<td>MAIL</td>
<td>Mail system</td>
</tr>
<tr class="a">
<td>DAEMON</td>
<td>System daemons</td>
</tr>
<tr class="b">
<td>AUTH</td>
<td>Security/authorization messages</td>
</tr>
<tr class="a">
<td>SYSLOG</td>
<td>Messages generated internally by syslogd</td>
</tr>
<tr class="b">
<td>LPR</td>
<td>Line printer subsystem</td>
</tr>
<tr class="a">
<td>NEWS</td>
<td>Network news subsystem</td>
</tr>
<tr class="b">
<td>UUCP</td>
<td>UUCP subsystem</td>
</tr>
<tr class="a">
<td>CRON</td>
<td>Clock daemon</td>
</tr>
<tr class="b">
<td>AUTHPRIV</td>
<td>Security/authorization messages (private)</td>
</tr>
<tr class="a">
<td>LOCAL0</td>
<td>Reserved for local use</td>
</tr>
<tr class="b">
<td>LOCAL1</td>
<td>Reserved for local use</td>
</tr>
<tr class="a">
<td>LOCAL2</td>
<td>Reserved for local use</td>
</tr>
<tr class="b">
<td>LOCAL3</td>
<td>Reserved for local use</td>
</tr>
<tr class="a">
<td>LOCAL4</td>
<td>Reserved for local use</td>
</tr>
<tr class="b">
<td>LOCAL5</td>
<td>Reserved for local use</td>
</tr>
<tr class="a">
<td>LOCAL6</td>
<td>Reserved for local use</td>
</tr>
<tr class="b">
<td>LOCAL7</td>
<td>Reserved for local use</td>
</tr>
</tbody>
</table>
<p class="alert alert-warning">Warning: <tt>USER</tt> is the only facility available on
Windows operating systems.</p>
</div>
<a name="Options"></a><div class="section" id="Options"><h3>Options<a name="Options"></a></h3>
<p>The following additional syslog options may be defined via the <i>option</i> parameter:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>CONS</td>
<td>If there is an error while sending data to the system logger, write directly to the
system console</td>
</tr>
<tr class="a">
<td>NDELAY</td>
<td>Open the connection to the logger immediately.</td>
</tr>
<tr class="b">
<td>ODELAY</td>
<td>Delay opening the connection until the first message is logged (default).</td>
</tr>
<tr class="a">
<td>PERROR</td>
<td>Print log messages also to standard error.</td>
</tr>
<tr class="b">
<td>PID</td>
<td>Include the PID with each message.</td>
</tr>
</tbody>
</table>
<p>Multiple options may be set by separating them with a pipe character. For example
<tt>CONS|PID|NODELAY</tt>.</p>
<p class="alert-message warning">Warning: When setting multiple options in an INI configuration file,
be sure to put the options string in quotes. Otherwise they will not be parsed correctly.</p>
</div>
<div class="section"><h3>Examples<a name="Examples"></a></h3>
<p>Here is a sample configuration:</p>
<div class="auto-tabs">
<ul>
<li>XML</li>
<li>PHP</li>
</ul>
<div class="tab-content">
<div class="tab-pane">
<div><pre class="prettyprint linenums">
&lt;configuration xmlns=&quot;http://logging.apache.org/log4php/&quot;&gt;
&lt;appender name=&quot;default&quot; class=&quot;LoggerAppenderSyslog&quot;&gt;
&lt;layout class=&quot;LoggerLayoutSimple&quot; /&gt;
&lt;param name=&quot;ident&quot; value=&quot;log4php-test&quot; /&gt;
&lt;param name=&quot;facility&quot; value=&quot;LOCAL0&quot; /&gt;
&lt;param name=&quot;option&quot; value=&quot;NDELAY|PID&quot; /&gt;
&lt;/appender&gt;
&lt;root&gt;
&lt;appender_ref ref=&quot;default&quot; /&gt;
&lt;/root&gt;
&lt;/configuration&gt;
</pre></div>
</div>
<div class="tab-pane">
<div><pre class="prettyprint linenums">
array(
'appenders' =&gt; array(
'default' =&gt; array(
'class' =&gt; 'LoggerAppenderSyslog',
'layout' =&gt; array(
'class' =&gt; 'LoggerLayoutSimple',
),
'params' =&gt; array(
'ident' =&gt; 'log4php-test',
'facility' =&gt; 'LOCAL0',
'option' =&gt; 'NDELAY|PID'
),
),
),
'rootLogger' =&gt; array(
'appenders' =&gt; array('default'),
),
);
</pre></div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>
</div>
<div class="footer">
<p>Copyright &#169; 2012
<a href="http://www.apache.org">Apache Software Foundation</a>.
All Rights Reserved.
Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache Software License, Version 2.0</a>.
Please read the <a href="../../privacy.html">Privacy policy</a></p>
<p>Apache log4php, Apache, log4php, the Apache feather logo, the Apache Logging Services project logo and the Built by
Maven logo are trademarks of The Apache Software Foundation.</p>
<p>Site powered by <a class="external" href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a>. Icons from
<a class="external" href="http://glyphicons.com/">Glyphicons Free</a>.</p>
</div>
</body>
</html>