toolbox.services.util.logging
Class LoggingFormatterTemplateImpl

Package class diagram package LoggingFormatterTemplateImpl
java.lang.Object
  extended by toolbox.services.BaseService
      extended by toolbox.services.util.logging.LoggingFormatterTemplateImpl
All Implemented Interfaces:
Service, LoggingFormatter

public class LoggingFormatterTemplateImpl
extends BaseService
implements LoggingFormatter

Formatter implementation that employs a TemplateService to format LogMessage instances.

This service must be configured with an XML configuration document similar to the following:

   <?xml version="1.0"?>
     <LoggingFormatterTemplateImpl>
       <templates>
        <INFO>my_info_tmpl.ftl</INFO>
        <WARN>my_warn_tmpl.ftl</WARN>
        <ERROR>my_err_tmpl.ftl</ERROR>
        <FATAL>my_fatal_tmpl.ftl</FATAL>
      </templates>
    </LoggingFormatterTemplateImpl>
 


Constructor Summary
LoggingFormatterTemplateImpl()
          Default constructor.
 
Method Summary
 java.lang.String format(LogMessage message)
          Format the given message.
 void setTemplateService(TemplateService tmplSvc)
          Injection point for the TemplateService dependency.
 
Methods inherited from class toolbox.services.BaseService
create, destroy, getConfigHome, getName, getProperties, getProperty, getXMLProperties, logConfig, logFine, logFiner, logFinest, logInfo, logSevere, logWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingFormatterTemplateImpl

public LoggingFormatterTemplateImpl()
Default constructor.

Method Detail

format

public java.lang.String format(LogMessage message)
Format the given message.

Specified by:
format in interface LoggingFormatter
Returns:
String containing the formatted LogMessage content.

setTemplateService

public void setTemplateService(TemplateService tmplSvc)
Injection point for the TemplateService dependency.

Parameters:
tmplSvc - TemplateService instance that must be used to format log messages.