<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->

<refentry xml:id="seaslog.analyzerdetail" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>SeasLog::analyzerDetail</refname>
  <refpurpose>Get log detail by level, log_path, key_word, start, limit, order</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <modifier>static</modifier> <type>mixed</type><methodname>SeasLog::analyzerDetail</methodname>
   <methodparam><type>string</type><parameter>level</parameter></methodparam>
   <methodparam choice="opt"><type>string</type><parameter>log_path</parameter></methodparam>
   <methodparam choice="opt"><type>string</type><parameter>key_word</parameter></methodparam>
   <methodparam choice="opt"><type>int</type><parameter>start</parameter></methodparam>
   <methodparam choice="opt"><type>int</type><parameter>limit</parameter></methodparam>
   <methodparam choice="opt"><type>int</type><parameter>order</parameter></methodparam>
  </methodsynopsis>
  <para>
    `SeasLog` get results of 
    `grep -ai '{level}' | grep -ai '{key_word}' |  sed -n '{start},{limit}'p` 
    use system pipe and return array to PHP.
  </para>

 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <variablelist>
   <varlistentry>
    <term><parameter>level</parameter></term>
    <listitem>
     <para>
      String. The log information level.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>log_path</parameter></term>
    <listitem>
     <para>
      String. The log information path.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>key_word</parameter></term>
    <listitem>
     <para>
      String. The search key word for log information.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>start</parameter></term>
    <listitem>
     <para>
      Int. Default is `1`.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>limit</parameter></term>
    <listitem>
     <para>
      Int. Default is `20`.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>order</parameter></term>
    <listitem>
     <para>
      Int. Default is <link linkend="constant.seaslog-detail-order-asc">SEASLOG_DETAIL_ORDER_ASC</link>.
      See also:
        <simplelist>
         <member><link linkend="constant.seaslog-detail-order-asc">SEASLOG_DETAIL_ORDER_ASC</link></member>
         <member><link linkend="constant.seaslog-detail-order-desc">SEASLOG_DETAIL_ORDER_DESC</link></member>
        </simplelist>
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Return results as array.
   <note>
    <para>
     When `start`,`limit` is not NULL and in Windows, 
     SeasLog will threw exception with message 'Param start and limit don't support Windows'.
    </para>
   </note>
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <example>
   <title><function>SeasLog::analyzerDetail</function> example</title>
   <programlisting role="php">
<![CDATA[
<?php

$result1 = SeasLog::analyzerDetail(SEASLOG_ERROR);

//with `logger` and `key_word`
$result2 = SeasLog::analyzerDetail(SEASLOG_ERROR,'test/logger/','neeke');

//with `start` and `limit`
$result3 = SeasLog::analyzerDetail(SEASLOG_ERROR,'test/logger/','neeke',1,2);

var_dump($result1,$result2,$result3);
?>
]]>
   </programlisting>
   &example.outputs.similar;
   <screen>
<![CDATA[
array(20) {
  [0]=>
  string(93) "2018-07-09 12:52:53 | ERROR | 12247 | 5b42ea2580e51 | 1531111973.528 | log message from neeke"
  [1]=>
  string(93) "2018-07-09 12:52:54 | ERROR | 12256 | 5b42ea26d6657 | 1531111974.878 | log message from neeke"
  [2]=>
  string(93) "2018-07-09 12:52:55 | ERROR | 12265 | 5b42ea277b8d4 | 1531111975.506 | log message from neeke"
  [3]=>
  string(104) "2018-07-09 12:52:55 | ERROR | 12274 | 5b42ea27db5dc | 1531111975.898 | log message from the other people"
...
}

array(3) {
  [0]=>
  string(93) "2018-07-09 12:52:53 | ERROR | 12247 | 5b42ea2580e51 | 1531111973.528 | log message from neeke"
  [1]=>
  string(93) "2018-07-09 12:52:54 | ERROR | 12256 | 5b42ea26d6657 | 1531111974.878 | log message from neeke"
  [2]=>
  string(93) "2018-07-09 12:52:55 | ERROR | 12265 | 5b42ea277b8d4 | 1531111975.506 | log message from neeke"
}

array(2) {
  [0]=>
  string(93) "2018-07-09 12:52:53 | ERROR | 12247 | 5b42ea2580e51 | 1531111973.528 | log message from neeke"
  [1]=>
  string(93) "2018-07-09 12:52:54 | ERROR | 12256 | 5b42ea26d6657 | 1531111974.878 | log message from neeke"
}
]]>
   </screen>
  </example>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member><methodname>SeasLog::analyzerCount</methodname></member>
  </simplelist>
 </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
-->
