mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-24 17:02:18 +01:00
* preface rev id sync * FPM section sync with EN * network section sync with EN * network section sync with EN * pcntl section sync with EN
191 lines
5.3 KiB
XML
191 lines
5.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 61374bbe228e8e9c55a24aba59a1e2bb2a871148 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="function.syslog" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>syslog</refname>
|
|
<refpurpose>Génère un message dans l'historique système</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>true</type><methodname>syslog</methodname>
|
|
<methodparam><type>int</type><parameter>priority</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>message</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>syslog</function> génère un message qui
|
|
sera inscrit dans l'historique par le système.
|
|
</para>
|
|
<para>
|
|
Pour plus d'informations sur comment mettre en place un gestionnaire
|
|
d'historique, reportez-vous au manuel Unix, page 5
|
|
<citerefentry><refentrytitle>syslog.conf</refentrytitle>
|
|
<manvolnum>5</manvolnum></citerefentry>. D'autres informations
|
|
sur les systèmes d'historique et leurs options sont aussi
|
|
disponibles dans le manuel <citerefentry><refentrytitle>syslog</refentrytitle>
|
|
<manvolnum>3</manvolnum></citerefentry> des machines Unix.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>priority</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<parameter>priority</parameter> est une combinaison des valeurs
|
|
d'accès et de niveau. Les valeurs possibles sont :
|
|
<table>
|
|
<title>Priorités <function>syslog</function> (en ordre décroissant)</title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Constante</entry>
|
|
<entry>Description</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><constant>LOG_EMERG</constant></entry>
|
|
<entry>système inutilisable</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LOG_ALERT</constant></entry>
|
|
<entry>une décision doit être prise immédiatement</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LOG_CRIT</constant></entry>
|
|
<entry>condition critique</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LOG_ERR</constant></entry>
|
|
<entry>condition d'erreur</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LOG_WARNING</constant></entry>
|
|
<entry>condition d'alerte</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LOG_NOTICE</constant></entry>
|
|
<entry>condition normale, mais significative</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LOG_INFO</constant></entry>
|
|
<entry>message d'information</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>LOG_DEBUG</constant></entry>
|
|
<entry>message de déboguage</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>message</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le message à envoyer.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.true.always;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>syslog</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// ouverture de syslog, ajout du PID et envoi simultané du
|
|
// message à la sortie standard et à un mécanisme
|
|
// spécifique
|
|
openlog("myScriptLog", LOG_PID | LOG_PERROR, LOG_LOCAL0);
|
|
|
|
// quelques lignes de code
|
|
|
|
if (authorized_client()) {
|
|
// faire quelquechose
|
|
} else {
|
|
// client non autorisé!
|
|
// notation de la tentative
|
|
$access = date("Y/m/d H:i:s");
|
|
syslog(LOG_WARNING, "Unauthorized client: $access {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})");
|
|
}
|
|
|
|
closelog();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<para>
|
|
Sur Windows, l'historique est pris en charge par le log d'événements.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
L'utilisation de <constant>LOG_LOCAL0</constant> à
|
|
<literal>LOG_LOCAL7</literal> pour le paramètre
|
|
<parameter>facility</parameter> de la fonction <function>openlog</function>
|
|
n'est pas disponible sous Windows.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>openlog</function></member>
|
|
<member><function>closelog</function></member>
|
|
<member>Paramètre INI <link linkend="ini.syslog.filter">syslog.filter</link> (à partir de PHP 7.3)</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
|
|
-->
|