<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.network.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.openlog.php',
    1 => 'openlog',
    2 => 'システムのロガーへの接続をオープンする',
  ),
  'up' => 
  array (
    0 => 'ref.network.php',
    1 => 'ネットワーク 関数',
  ),
  'prev' => 
  array (
    0 => 'function.net-get-interfaces.php',
    1 => 'net_get_interfaces',
  ),
  'next' => 
  array (
    0 => 'function.pfsockopen.php',
    1 => 'pfsockopen',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/network/functions/openlog.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.openlog" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">openlog</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">openlog</span> &mdash; <span class="dc-title">システムのロガーへの接続をオープンする</span></p>
 
 </div>
 
 <div class="refsect1 description" id="refsect1-function.openlog-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>openlog</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$prefix</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$flags</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$facility</code></span>): <span class="type"><a href="language.types.singleton.php" class="type true">true</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>openlog()</strong></span> は、プログラムによるシステムロガーへの接続をオープンします。
  </p>
  <p class="para"> 
   <span class="function"><strong>openlog()</strong></span> の使用は必須ではありません。この関数は、
   必要に応じて <span class="function"><a href="function.syslog.php" class="function">syslog()</a></span> により自動的に呼び出されます。
   この場合、<code class="parameter">prefix</code> のデフォルト値は空文字列となります。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openlog-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">prefix</code></dt>
     <dd>
      <p class="para">
       文字列 <code class="parameter">prefix</code> が、各メッセージに追加されます。
      </p>
     </dd>
    
    
     <dt><code class="parameter">flags</code></dt>
     <dd>
      <p class="para">
       以下の定数のビットマスクを指定します:
       <ul class="simplelist">
        <li><strong><code><a href="network.constants.php#constant.log-cons">LOG_CONS</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-ndelay">LOG_NDELAY</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-odelay">LOG_ODELAY</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-nowait">LOG_NOWAIT</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-perror">LOG_PERROR</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-pid">LOG_PID</a></code></strong></li>
       </ul>
      </p>
     </dd>
    
    
     <dt><code class="parameter">facility</code></dt>
     <dd>
      <p class="para">
       引数 <code class="parameter">facility</code> には、
       ロギングを行う際のメッセージ型を指定します。
       これにより、異なった facility からのメッセージをどのように処理するかを、
       設定ファイルが指定できるようになります。
       以下の定数のうち、ひとつを指定する必要があります:
       <ul class="simplelist">
        <li><strong><code><a href="network.constants.php#constant.log-auth">LOG_AUTH</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-authpriv">LOG_AUTHPRIV</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-cron">LOG_CRON</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-daemon">LOG_DAEMON</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-kern">LOG_KERN</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-local0">LOG_LOCAL<span class="replaceable">[0-7]</span></a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-lpr">LOG_LPR</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-mail">LOG_MAIL</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-news">LOG_NEWS</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-syslog">LOG_SYSLOG</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-user">LOG_USER</a></code></strong></li>
        <li><strong><code><a href="network.constants.php#constant.log-uucp">LOG_UUCP</a></code></strong></li>
       </ul>
      </p>
      <blockquote class="note"><p><strong class="note">注意</strong>: 
       <span class="simpara">
        このパラメータは、Windows では無視されます。
       </span>
      </p></blockquote>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.openlog-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   常に <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> を返します。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.openlog-changelog">
  <h3 class="title">変更履歴</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>バージョン</th>
      <th>説明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.2.0</td>
      <td>
       この関数は、常に <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> を返すようになりました。
       これより前のバージョンでは、失敗時に <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返していました。
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.openlog-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.syslog.php" class="function" rel="rdfs-seeAlso">syslog()</a> - システムログのメッセージを生成する</span></li>
    <li><span class="function"><a href="function.closelog.php" class="function" rel="rdfs-seeAlso">closelog()</a> - システムログへの接続を閉じる</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>