There are two ways to view logging messages:
Viewing Logging Messages in General Interface BuilderTo show logging messages during development, General Interface Builder defines a handler class, jsx3.ide.SystemLogHandler. This class handles logging messages by printing them in the System Log palette located in the bottom panel of the user interface. This handler class is configured in the logging system configuration file just like any other handler. The logging system configuration file, logger.xml, is located in the GI_HOME directory. The default configuration file includes the following lines that declare the General Interface Builder ide 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> The following lines register the ide handler with the global logger: <!-- The global logger. --> <logger name="global" level="INFO"> <handler-ref name="ide"/> </logger> By default, the ide handler is defined without a log level, so messages aren't filtered by level. Because the global logger is configured with level INFO, all messages of INFO and higher are forwarded to the ide handler and output to the System Log palette. TRACE and DEBUG messages aren't forwarded to the handler, regardless of the handler's level. If you add level =" WARN" as an attribute of the handler element, the System Log palette would only display messages of severity WARN and higher, instead of INFO and higher. For example, <handler name="ide" class="jsx3.ide.SystemLogHandler" lazy="true" level ="WARN"> Viewing Logging Messages at RuntimeRuntime access to the logging system is provided by the jsx3.app.Monitor handler class. This class handles logging messages by printing them in a separate browser window along side a running application. An application monitor has three running modes that correspond to four stages of application development:
To enable and use the application monitor,
Creating an Application Monitor HandlerA jsx3.app.Monitor handler must be configured for each monitored application. Add as many monitors as you'd like, each with a unique handler name, such as appMonitor1, appMonitor2, and so on. Monitors are matched up to applications by the serverNamespace property. The value for this property should be identical to the server namespace of the application, which is set in the deployment options (Project > Project Settings > Deployment). Alternatively, if the serverNamespace property is omitted, the application monitor is associated with the entire General Interface runtime rather than to a particular server.
In the following XML snippet of the logging system configuration file (logger.xml), two monitor handlers are created, one for each application. <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> <handler name="appMonitor2" class="jsx3.app.Monitor" require="true"> <property name="serverNamespace" value="yourApp"/> <property name="disableInIDE" eval="true" value="true"/> <property name="activateOnHotKey" eval="true" value="false"/> <property name="format" value="%t %n (%l) - %M"/> </handler>
Registering an Application Monitor Handler with a LoggerNext, you need to register each monitor with a logger in the logging system configuration file. In the following XML snippet, two application monitor handlers are registered with the global logger. <logger name="global" level="INFO"> <handler-ref name="memory"/> <handler-ref name="ide"/> <handler-ref name="appMonitor1"/> <handler-ref name="appMonitor2"/> </logger>
|
Contents
|
