Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > ebb1914cf182a88528b4547490db1dd8 > files > 623

kdewebdev-quanta-doc-3.5.9-2mdv2008.1.x86_64.rpm

<HTML
><HEAD
><TITLE
>error_log</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK
REL="HOME"
TITLE="PHP Manual"
HREF="manual.html"><LINK
REL="UP"
TITLE="PHP options & information"
HREF="ref.info.html"><LINK
REL="PREVIOUS"
TITLE="PHP options & information"
HREF="ref.info.html"><LINK
REL="NEXT"
TITLE="error_reporting"
HREF="function.error-reporting.html"></HEAD
><BODY
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="ref.info.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.error-reporting.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.error-log"
>error_log</A
></H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN22973"
></A
>error_log -- send an error message somewhere</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN22976"
></A
><H2
>Description</H2
><DIV
CLASS="funcsynopsis"
><P
></P
><CODE
CLASS="FUNCDEF"
>int error_log</CODE
>(string message, int message_type, string 
      [<SPAN
CLASS="optional"
>destination</SPAN
>]
     , string 
      [<SPAN
CLASS="optional"
>extra_headers</SPAN
>]
     );<P
></P
></DIV
><P
>&#13;     Sends an error message to the web server's error log, a
     <SPAN
CLASS="acronym"
>TCP</SPAN
> port or to a file.  The first parameter,
     <TT
CLASS="parameter"
><I
>message</I
></TT
>, is the error message that should
     be logged.  The second parameter,
     <TT
CLASS="parameter"
><I
>message_type</I
></TT
> says where the message should
     go:
     <DIV
CLASS="table"
><P
><B
>Table 1. <B
CLASS="function"
>error_log()</B
> log types</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>0</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;	  <TT
CLASS="parameter"
><I
>message</I
></TT
> is sent to PHP's system
	  logger, using the Operating System's system logging
	  mechanism or a file, depending on what the <A
HREF="configuration.html#ini.error-log"
>error_log</A
> configuration
	  directive is set to.
	 </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>1</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;	  <TT
CLASS="parameter"
><I
>message</I
></TT
> is sent by email to the
	  address in the <TT
CLASS="parameter"
><I
>destination</I
></TT
> parameter.
	  This is the only message type where the fourth parameter,
	  <TT
CLASS="parameter"
><I
>extra_headers</I
></TT
> is used.  This message
	  type uses the same internal function as
	  <B
CLASS="function"
>Mail()</B
> does.
	 </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>2</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;	  <TT
CLASS="parameter"
><I
>message</I
></TT
> is sent through the PHP
	  debugging connection.  This option is only available if
	  <A
HREF="install-unix.html#enable-debugger"
>remote debugging has been
	  enabled</A
>.  In this case, the
	  <TT
CLASS="parameter"
><I
>destination</I
></TT
> parameter specifies the
	  host name or IP address and optionally, port number, of the
	  socket receiving the debug information.
	 </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>3</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;	  <TT
CLASS="parameter"
><I
>message</I
></TT
> is appended to the file
	  <TT
CLASS="parameter"
><I
>destination</I
></TT
>.
	 </TD
></TR
></TABLE
></DIV
></P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><P
><B
>Example 1. <B
CLASS="function"
>error_log()</B
> examples</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>  1&nbsp;
  2&nbsp;// Send notification through the server log if we can not
  3&nbsp;// connect to the database.
  4&nbsp;if (!Ora_Logon($username, $password)) {
  5&nbsp;    error_log("Oracle database not available!", 0);
  6&nbsp;}
  7&nbsp;
  8&nbsp;// Notify administrator by email if we run out of FOO
  9&nbsp;if (!($foo = allocate_new_foo()) {
 10&nbsp;    error_log("Big trouble, we're all out of FOOs!", 1,
 11&nbsp;              "operator@mydomain.com");
 12&nbsp;}
 13&nbsp;
 14&nbsp;// other ways of calling error_log():
 15&nbsp;error_log("You messed up!", 2, "127.0.0.1:7000");
 16&nbsp;error_log("You messed up!", 2, "loghost");
 17&nbsp;error_log("You messed up!", 3, "/var/tmp/my-errors.log");
 18&nbsp;      </PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="ref.info.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="manual.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.error-reporting.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>PHP options &#38; information</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.info.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>error_reporting</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>