Zend_Application-AvailableResources-ZendMonitor.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect2 id="zend.application.available-resources.zendmonitor">
  4. <title>Zend_Application_Resource_Zendmonitor</title>
  5. <para>
  6. <classname>Zend_Application_Resource_Zendmonitor</classname> is a resource that instantiates
  7. a <classname>Zend_Log</classname> instance with an attached <link
  8. linkend="zend.log.writers.zendmonitor">Zend_Log_Writer_ZendMonitor</link> writer. It can
  9. then be used within your application to log events to Zend Server's event monitor.
  10. </para>
  11. <para>
  12. It has no configuration parameters; as such, you will simply need to specify it within your
  13. configuration. Examples include:
  14. </para>
  15. <programlisting language="dosini"><![CDATA[
  16. ; INI configuration:
  17. resources.zendmonitor[] =
  18. ]]></programlisting>
  19. <programlisting language="xml"><![CDATA[
  20. <!-- XML configuration -->
  21. <resources>
  22. <zendmonitor />
  23. </resources>
  24. ]]></programlisting>
  25. <para>
  26. Within your application, you can retrieve the logger from your bootstrap object:
  27. </para>
  28. <programlisting language="php"><![CDATA[
  29. $bootstrap->bootstrap('Zendmonitor');
  30. $log = $bootstrap->getResource('Zendmonitor');
  31. $log->info('some message');
  32. ]]></programlisting>
  33. <para>
  34. The default project structure generated by the <command>zf.sh</command> or
  35. <command>zf.bat</command> commands will configure the resource by default, and adds code
  36. into the <classname>ErrorController</classname> to log application exceptions to the Zend
  37. Server event monitor. You can disable this functionality simply by removing the resource
  38. configuration from your configuration file.
  39. </para>
  40. </sect2>