Log and Trace Analyzer provides standalone and plug-in support for the following logging utilities:
This support entails:
This support is provided by the following plugins:
Logging Utility |
Plug-in |
---|---|
Java Logging (JSR-047) |
org.eclipse.hyades.logging.java14 |
Apache Jakarta Commons Logging |
org.eclipse.hyades.logging.commons |
Apache Jakarta Log4J Logging |
org.eclipse.hyades.logging.log4j |
The following sections describe the details of each type of logging utility support, and provide pointers to samples that demonstrate how to use it..
An extension of the java.util.logging.LogRecord class under the org.eclipse.hyades.logging.java14 package allows you to create a customized log record for logging an org.eclipse.hyades.logging.events.cbe.CommonBaseEvent in a java.util.logging.LogRecord. This org.eclipse.hyades.logging.java14.CommonBaseEventLogRecord extends java.util.logging.LogRecord and contains a reference to an org.eclipse.hyades.logging.events.cbe.CommonBaseEvent. All java.util.logging.LogRecord properties are mapped to one or more Common Base Event properties to maintain reflexivity for non-Common Base Event aware handlers and formatters.
An implementation of the java.util.logging.Filter interface under the org.eclipse.hyades.logging.java14 package only permits org.eclipse.hyades.logging.java14.CommonBaseEventLogRecords to be successfully logged.
An extension of the java.util.logging.Formatter abstract class under the org.eclipse.hyades.logging.java14 package allows you to configure handlers to format org.eclipse.hyades.logging.java14.CommonBaseEventLogRecord and java.util.logging.LogRecord log messages to XML. This org.eclipse.hyades.logging.java14.XmlFormatter formatter converts the org.eclipse.hyades.logging.java14.CommonBaseEventLogRecord or java.util.logging.LogRecord log message to XML based on the Common Base Event v1.0.1 schema. When formatting, the log message is checked to see if it implements the org.eclipse.hyades.logging.core.IExternalizableToXml interface (e.g. org.eclipse.hyades.logging.java14.CommonBaseEventLogRecord). If so, the externalizeCanonicalXmlString() API is called in place of XML serialization. Otherwise, the java.util.logging.LogRecord log message is converted to a Common Base Event object using the same mapping as in the org.eclipse.hyades.logging.events.cbe.CommonBaseEvent and serialized to XML by calling the externalizeCanonicalXmlString() API.
An extension of the java.util.logging.Handler
abstract class under the org.eclipse.hyades.logging.java package
allows loggers to be configured to log
org.eclipse.hyades.logging.events.cbe.CommonBaseEvent and
java.util.logging.LogRecordlog messages to a logging agent.
This org.eclipse.hyades.logging.java.LoggingAgentHandler handler checks to see if the org.eclipse.hyades.logging.java14.CommonBaseEventLogRecord or java.util.logging.LogRecord log message that is logged to a logger can be logged based on the logger's and handler's filter and logging level. If the log message is to be logged, a logging agent is resolved with the same name as the logger that logs the message. Otherwise, you may use the org.eclipse.hyades.logging.java.SingleLoggingAgentHandler handler, which creates one logging agent, named Logging Agent Handler. The message is formatted in XML using an org.eclipse.hyades.logging.java.XmlFormatter and written to the logging agent.
Illustrative sample
A sample is provided to show how to leverage the support for Java Logging (JSR-047) by illustrating the configuration and instrumentation required for new and existing users of the standalone and plug-in support for Java Logging (JSR-047). For more information, open File > New > Example... > Hyades Logging > Hyades JSR-047 Logging Sample.
An implementation of the org.apache.commons.logging.Log interface under the org.eclipse.hyades.logging.commons package lets you create a logger for logging org.eclipse.hyades.logging.events.cbe.CommonBaseEvent, java.lang.Object and java.lang.Throwable log messages. This org.eclipse.hyades.logging.commons.Logger checks to see if org.eclipse.hyades.logging.events.cbe.CommonBaseEvent, java.lang.Object or java.lang.Throwable log message that is logged to a logger can be logged based on the logger's logging level. If the log message is to be logged, the org.eclipse.hyades.logging.events.cbe.CommonBaseEvents, java.lang.Object or java.lang.Throwable log message is formatted and logged. An implementation of the org.apache.commons.logging.LogFactory abstract class is provided which represents a proxy factory specific for org.eclipse.hyades.logging.commons.Logger instances. This org.eclipse.hyades.logging.commons.LoggerFactory proxy factory is intended for use in multiple class loader environments where one or more different types of loggers and their factories are required for each separate class loader, all utilizing the same Apache Commons binaries.
The org.eclipse.hyades.logging.commons.Logger formats org.eclipse.hyades.logging.events.cbe.CommonBaseEvent, java.lang.Object and java.lang.Throwable log messages to XML based on the Common Base Event v1.0.1 schema. When formatting, the log message is checked to see if it implements the org.eclipse.hyades.logging.core.IExternalizableToXml interface (for example, org.eclipse.hyades.logging.events.cbe.CommonBaseEvent). If so, the externalizeCanonicalXmlString() API is called in place of XML serialization. Otherwise, the java.lang.Object or java.lang.Throwablelog message is converted to a Common Base Event object using the org.eclipse.hyades.internal.logging.core.XmlGenerator and serialized to XML by calling the externalizeCanonicalXmlString() API.
The org.eclipse.hyades.logging.commons.Logger logs org.eclipse.hyades.logging.events.cbe.CommonBaseEvent, java.lang.Object and java.lang.Throwable log messages to a logging agent. If the log message is to be logged, a logging agent is resolved with the same name as the logger that logs the message. The message is formatted to XML and written to the logging agent.
An implementation of the org.apache.commons.logging.Log interface under the org.eclipse.hyades.logging.commons package lets you create a logger for logging org.eclipse.hyades.logging.events.cbe.CommonBaseEvent, java.lang.Object and java.lang.Throwable log messages to a local file. This org.eclipse.hyades.logging.commons.FileLogger checks to see if the org.eclipse.hyades.logging.events.cbe.CommonBaseEvent, java.lang.Object or java.lang.Throwable log message that is logged to a logger can be logged based on the logger's logging level. If the log message is to be logged, the org.eclipse.hyades.logging.events.cbe.CommonBaseEvent, java.lang.Object or java.lang.Throwable log message is formatted to XML and logged to a local file. An implementation of the org.apache.commons.logging.LogFactory abstract class is provided which represents a proxy factory specific for org.eclipse.hyades.logging.commons.FileLogger instances. This org.eclipse.hyades.logging.commons.FileLoggerFactoryproxy factory is intended for use in multiple class loader environments where one or more different types of loggers and their factories are required for each separate class loader, all utilizing the same Apache Commons binaries.
Illustrative sample
A sample is provided to show how to leverage the support for Apache Jakarta Commons Logging by illustrating the configuration and instrumentation required for new and existing users of the standalone and plug-in support for Apache Jakarta Commons Logging. For more information, see File > New > Example... > Hyades Logging > Hyades Apache Commons Logging Sample.
The message property of the org.apache.log4j.spi.LoggingEvent log message lets you log an org.eclipse.hyades.logging.events.cbe.CommonBaseEvent.
An extension of the org.apache.log4j.spi.Filterabstract class under the org.eclipse.hyades.logging.log4j package only permits org.eclipse.hyades.logging.events.cbe.CommonBaseEvents to be successfully logged.
An extension of the org.apache.log4j.Layout abstract class under the org.eclipse.hyades.logging.log4j package allows you to configure appenders to format org.eclipse.hyades.logging.events.cbe.CommonBaseEvent and org.apache.log4j.spi.LoggingEventlog messages to XML. This org.eclipse.hyades.logging.log4j.XmlLayout formatter converts the org.eclipse.hyades.logging.events.cbe.CommonBaseEvent or org.apache.log4j.spi.LoggingEventlog message to XML based on the Common Base Event v1.0.1 schema. When formatting, the log message is checked to see if the message property of the org.apache.log4j.spi.LoggingEvent implements the org.eclipse.hyades.logging.core.IExternalizableToXml interface (for example, org.eclipse.hyades.logging.events.cbe.CommonBaseEvent). If so, the externalizeCanonicalXmlString() API is called in place of XML serialization. Otherwise, the org.apache.log4j.spi.LoggingEventlog message is converted to a Common Base Event object using the org.eclipse.hyades.internal.logging.core.XmlGeneratorand serialized to XML by calling the externalizeCanonicalXmlString() API.
An extension of the org.apache.log4j.AppenderSkeleton
abstract class under the org.eclipse.hyades.logging.log4j package
allows loggers to be configured to log
org.eclipse.hyades.logging.events.cbe.CommonBaseEvent and
org.apache.log4j.spi.LoggingEventlog messages to a logging agent.
This org.eclipse.hyades.logging.log4j.LoggingAgentAppender appender checks to see if the org.eclipse.hyades.logging.events.cbe.CommonBaseEvent and org.apache.log4j.spi.LoggingEvent log message that is logged to a logger can be logged based on the logger's and appender's filter and logging level. If the log message is to be logged, a Logging Agent is resolved with the same name as the logger that logs the message. Otherwise, you may use the org.eclipse.hyades.logging.log4j.SingleLoggingAgentAppender appender which creates one logging agent, named Logging Agent Appender. The message is formatted to XML using an org.eclipse.hyades.logging.log4j.XmlLayout and written to the logging agent.
Illustrative sample
A sample is provided to show how to leverage the support for Apache Jakarta Log4J Logging by illustrating the configuration and instrumentation required for new and existing users of the standalone and plug-in support for Apache Jakarta Log4J Logging. For more information, see File > New > Example... > Hyades Logging > Hyades Apache Log4J Logging Sample.
Related concepts
Common Base Event model
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.