| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Reviewed: no -->
- <sect2 id="zend.application.available-resources.zendmonitor">
- <title>Zend_Application_Resource_Zendmonitor</title>
- <para>
- <classname>Zend_Application_Resource_Zendmonitor</classname> is a resource that instantiates
- a <classname>Zend_Log</classname> instance with an attached <link
- linkend="zend.log.writers.zendmonitor">Zend_Log_Writer_ZendMonitor</link> writer. It can
- then be used within your application to log events to Zend Server's event monitor.
- </para>
- <para>
- It has no configuration parameters; as such, you will simply need to specify it within your
- configuration. Examples include:
- </para>
- <programlisting language="dosini"><![CDATA[
- ; INI configuration:
- resources.zendmonitor[] =
- ]]></programlisting>
- <programlisting language="xml"><![CDATA[
- <!-- XML configuration -->
- <resources>
- <zendmonitor />
- </resources>
- ]]></programlisting>
- <para>
- Within your application, you can retrieve the logger from your bootstrap object:
- </para>
- <programlisting language="php"><![CDATA[
- $bootstrap->bootstrap('Zendmonitor');
- $log = $bootstrap->getResource('Zendmonitor');
- $log->info('some message');
- ]]></programlisting>
- <para>
- The default project structure generated by the <command>zf.sh</command> or
- <command>zf.bat</command> commands will configure the resource by default, and adds code
- into the <classname>ErrorController</classname> to log application exceptions to the Zend
- Server event monitor. You can disable this functionality simply by removing the resource
- configuration from your configuration file.
- </para>
- </sect2>
|