General Interface is an open source project hosted by the Dojo Foundation

Understanding the Logging System Configuration File

The logging system configuration file, GI_HOME/logger.xml, specifies which logging messages are displayed, how they are displayed, and where they are sent.

You can also edit logger.xml, as well as create a custom logging system configuration file. See Creating a Custom Logging System Configuration File.

Memory Handler

The memory handler stores a rotating cache of logging messages in memory. Note that some features of the General Interface Builder IDE require this handler. If it's not available, they won't function properly.

<handler name="memory" class="jsx3.util.Logger.MemoryHandler">
  <property name="bufferSize" eval="true" value="1000"/>
</handler>

Memory Handler Attributes

See Handler Attributes.

Memory Handler Properties

The memory handler has the following property:

  • bufferSize : The size of the buffer and the number of records the buffer holds until it begins discarding old ones.

System Log Handler

The system log handler prints logging messages to the General Interface Builder System Log palette in the IDE. For logging to work in the IDE, there must be only one system log handler.

<handler name="ide" class="jsx3.ide.SystemLogHandler" lazy="true">
  <property name="bufferSize" eval="true" value="0"/>
  <property name="format" value="%t %n (%l) - %M"/>
  <property name="beepLevel" eval="true"
    value="jsx3.util.Logger.ERROR"/>
</handler>

System Log Handler Attributes

See Handler Attributes.

System Log Handler Properties

The system log handler has the following properties:

  • bufferSize : The size of the buffer and the number of records the buffer holds until it begins discarding old ones.
  • format : The format of the delivered message. For definitions of formatting tokens, see jsx3.util.Logger.FormatHandler in General Interface API Reference.
  • beepLevel : The message level that triggers a sound when printed to the System Log palette in the IDE. For more information, see Enabling Sound for Messages.
    For sound to work properly, Firefox requires a plug-in that can play .wav files.

JavaScript Alert Handler

The alert handler sends formatted messages to a JavaScript alert. The fatal handler, as configured in the default logger.xml file, ensures that fatal errors are displayed in a JavaScript alert. Fatal messages usually relate to failure to initialize the system or load an application and so may indicate that the output of other handlers isn't visible.

<handler name="alerter" class="jsx3.util.Logger.AlertHandler"
  level="ERROR">
  <property name="format" value="%t %n (%l) - %M"/>
</handler>

<handler name="fatal" class="jsx3.util.Logger.AlertHandler"
   level="FATAL">
  <property name="format" value="%t %n (%l) - %M"/>
</handler>

JavaScript Alert Handler Attributes

See Handler Attributes.

JavaScript Alert Handler Properties

The AlertHandler class has the following property:

  • format: The format of the delivered message. For definitions of formatting tokens, see jsx3.util.Logger.FormatHandler in General Interface API Reference.

The alert handler is registered with the jsx3.util.Logger logger to capture any errors not handled correctly by the other handlers.

<logger name="jsx3.util.Logger" level="WARN" useParent="false">
  <handler-ref name="alerter"/>
</logger>

Application Monitor Handler

When an application monitor handler is registered for an application running outside of General Interface Builder, logging messages are sent to a separate browser window. This is useful for testing and debugging a deployed application.

The logging system configuration file provides a template for creating an application monitor handler. By default, the application monitor is disabled. For more information, see Creating an Application Monitor Handler.

<handler name="appMonitor1" class="jsx3.app.Monitor"
   require="true">
  <property name="serverNamespace" value="myApp"/>
  <property name="disableInIDE" eval="true" value="true"/>
  <property name="activateOnHotKey" eval="true" value="false"/>
  <property name="format" value="%t %n (%l) - %M"/>
</handler>

Application Monitor Handler Attributes

See Handler Attributes.

Application Monitor Handler Properties

The application monitor handler has the following properties:

  • serverNamespace: The value must match the application namespace to associate the application monitor with the application. The namespace is specified in the Namespace field on the Deployment panel of the Project Settings dialog.
    If the serverNamespace property value is omitted, the application monitor is associated with the entire General Interface runtime rather than to a particular server instance. If this attribute is omitted, the disableInIDE and activateOnHotKey attributes have no meaning.
  • disableInIDE: If set to true, the application monitor is disabled when the application is running in the IDE. If set to false, the application monitor is enabled in the IDE. The default setting is true.
  • activateOnHotKey: If false, this monitor appears when the application is loaded and when the monitor is closed and a logging message is received. If true, this monitor is only launched when pressing the keyboard shortcut, Ctrl+Alt+m, in the running application. The default setting is false.
  • format : The format of the delivered message. For definitions of formatting tokens, see jsx3.util.Logger.FormatHandler in General Interface API Reference.

Global Logger

The global logger is the ancestor of all other loggers. Custom handlers and application monitor handlers can be registered with the global logger.

<logger name="global" level="INFO">
  <handler-ref name="memory"/>
  <handler-ref name="ide"/>
</logger>

Alternately, handlers can be registered with a descendant logger.

<logger name="system.critical" level="FATAL">
  <handler-ref name="page_ceo"/>
</logger>

Any logger can have the following attributes and nested entities:

  • Logger attributes:
    • name : The unique name of the logger.
    • level : Controls which messages pass through the logger. If this attribute is omitted, all log levels pass through the logger. See Log Levels.
  • Nested entities — handler-ref:
    • name : The name of the handler registered with the global logger. Custom handlers and application monitor handlers can be registered here.

Handler Attributes

Handlers can include the following attributes:

  • name : The unique name of the handler.
  • class : The name of the handler class.
  • lazy : If true, the logging system waits for the class to load on its own. Use the lazy or require attribute but not both.
  • require : If tru e, the class is loaded immediately after all statically loaded classes load using the dynamic class loading mechanism. If the specified handler class isn't statically loaded, use require="true", so the class is loaded and available when it's needed. For a list of statically loaded classes, see General Interface Framework Classes. Use the lazy or require attribute but not both.
  • level : Controls which messages the handler outputs. See Log Levels.

Contents

Searching General Interface Docs

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.