mirror of
https://github.com/php/doc-es.git
synced 2026-03-24 07:22:16 +01:00
156 lines
4.2 KiB
XML
156 lines
4.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 35ca7f1087870c6023ef7a3dd0248501741c8194 Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="function.syslog" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>syslog</refname>
|
|
<refpurpose>Genera un mensaje en el historial del sistema</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> genera un mensaje que
|
|
será registrado en el historial por el sistema.
|
|
</para>
|
|
<para>
|
|
Para más información sobre cómo configurar un gestor
|
|
de historial, consúltese el manual Unix, página 5
|
|
<citerefentry><refentrytitle>syslog.conf</refentrytitle>
|
|
<manvolnum>5</manvolnum></citerefentry>. Otra información
|
|
sobre los sistemas de historial y sus opciones también
|
|
está disponible en el manual <citerefentry><refentrytitle>syslog</refentrytitle>
|
|
<manvolnum>3</manvolnum></citerefentry> de las máquinas Unix.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>priority</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Una de las
|
|
<simplelist type="inline">
|
|
<member><constant>LOG_EMERG</constant></member>
|
|
<member><constant>LOG_ALERT</constant></member>
|
|
<member><constant>LOG_CRIT</constant></member>
|
|
<member><constant>LOG_ERR</constant></member>
|
|
<member><constant>LOG_WARNING</constant></member>
|
|
<member><constant>LOG_NOTICE</constant></member>
|
|
<member><constant>LOG_INFO</constant></member>
|
|
<member><constant>LOG_DEBUG</constant></member>
|
|
</simplelist>
|
|
constantes.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>message</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El mensaje a enviar.
|
|
</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>Ejemplo con <function>syslog</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// apertura de syslog, adición del PID y envío simultáneo del
|
|
// mensaje a la salida estándar y a un mecanismo
|
|
// específico
|
|
openlog("myScriptLog", LOG_PID | LOG_PERROR, LOG_LOCAL0);
|
|
|
|
// algunas líneas de código
|
|
|
|
if (authorized_client()) {
|
|
// hacer algo
|
|
} else {
|
|
// cliente no autorizado!
|
|
// registro del intento
|
|
$access = date("Y/m/d H:i:s");
|
|
syslog(LOG_WARNING, "Cliente no autorizado: $access {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})");
|
|
}
|
|
|
|
closelog();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<para>
|
|
En Windows, el historial es gestionado por el registro de eventos.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
El uso de <constant>LOG_LOCAL0</constant> a
|
|
<literal>LOG_LOCAL7</literal> para el argumento
|
|
<parameter>facility</parameter> de la función <function>openlog</function>
|
|
no está disponible en Windows.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>openlog</function></member>
|
|
<member><function>closelog</function></member>
|
|
<member>Parámetro INI <link linkend="ini.syslog.filter">syslog.filter</link> (a 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
|
|
-->
|