<?xml version='1.0' encoding='UTF-8'?>
<chapter>
  <chapterinfo>
    <keywordset>
      <keyword>a4j:log</keyword>
    </keywordset>
  </chapterinfo>
  <table frame="all">
         <title>Component identification parameters</title>
        <tgroup cols="2">
	  <thead>
            <row>
                <entry>Name</entry>
                <entry>Value</entry>
            </row>
        </thead>
          <tbody>
            <row>
              <entry>component-type</entry>
              <entry>org.ajax4jsf.Log</entry>
            </row>
            <row>
              <entry>component-family</entry>
              <entry>org.ajax4jsf.Log</entry>
            </row>
            <row>
              <entry>component-class</entry>
              <entry>org.ajax4jsf.component.html.AjaxLog</entry>
            </row>
            <row>
              <entry>renderer-type</entry>
              <entry>org.ajax4jsf.LogRenderer</entry>
            </row>
          </tbody>
        </tgroup>
      </table>

  <section>
    <title>Creating the Component with a Page Tag</title>
    <para>To create the simplest variant on a page use the following syntax:</para><programlisting role="XML"><![CDATA[<a4j:log popup="false" level="ALL" style="width: 800px; height: 300px;"></a4j:log>]]></programlisting>
    <para>Then, in order to open a log window, press &quot;CTRL+SHIFT+L&quot; on a page with the component.</para>
  </section>
  <section>
    <title>Creating the Component Dynamically Using Java</title>

  <para>
      <emphasis role="bold">Example:</emphasis>
 </para>
    <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.component.html.AjaxLog;
...
AjaxLog myLog = new AjaxLog();
...]]></programlisting>
  </section>
  <section>
    <title>Key attributes and ways of usage</title>
    <para>Usage of the appropriate component attributes could change a representation level of debug information as well as the  hot key for a window opening.</para>
    <para>The hot key could be changed with the <emphasis >
        <property>&quot;hotkey&quot;</property>
       </emphasis> 
attribute, where it&apos;s necessary to define one letter that together with &quot;CTRL+SHIFT&quot; opens a window.</para>
    <para>The <emphasis >
        <property>&quot;level&quot;</property>
       </emphasis> 
attribute with several possible values (FATAL, ERROR, WARN, INFO, ALL) could change a logging level.</para>
    <para>The log could be generated not only in a new window, but also on the current page in a separate <emphasis role="bold"><property>&lt;div&gt;</property></emphasis>, this is also controlled with the <emphasis >
        <property>&quot;popup&quot;</property>
       </emphasis> 
attribute on the component. </para>
    <para><emphasis role="bold">Example:</emphasis>
    </para>
	<programlisting role="XML"><![CDATA[<a4j:log level="ALL" popup="false" width="400" height="200"/>]]></programlisting>
    <para>The component defined this way is decoded on a page as <emphasis role="bold"><property>&lt;div&gt;</property></emphasis> inside a page, where all the information beginning with informational message is generated.</para>
    <note>
      <title>Note:</title>
      <para><emphasis role="bold"><property>&lt;a4j:log&gt;</property></emphasis> is getting renewed automatically after execution of Ajax requests. Don't renew <emphasis role="bold"><property>&lt;a4j:log&gt;</property></emphasis> by using reRender!</para>
    </note>
  </section>

  <section>
    <title>Relevant resources links</title>
	<para>
	   <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/log.jsf?c=log">Here</ulink> you can see the example of <emphasis role="bold"
	     ><property>&lt;a4j:log&gt;</property></emphasis> usage and sources for the given example.
	</para>
  </section>   
</chapter>
