|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.are.service.BaseSingletonService
com.ibm.are.service.LoggingService
public final class LoggingService
The LoggingService
class is final class that implements the AutoStartSingletonService
interface.
This following services are provided by this class:
Launcher
class
for more information on command line parameters and properties for the Application Runtime ExpertBy far the most valuable feature of this service is the ability to easily retrieve a reference to the global logger. All of the plugins shipped as part of the Application Runtime Expert use the global logger. So developers of their own plugins should consider also using the global logger; having all plugins log to the same file makes it easy to find and correlate log entries for all plugins.
Here is an example of how to retrieve a reference to the global logger. This example will work from any service or plugin:
ElementManager elementMgr = AreCore.get().elementManager(); Service loggingService = elementMgr.findService("com.ibm.are.service.LoggingService"); Logger globalLogger = ((LoggingService)loggingService).getGlobalLogger();
Because logging is an integral part of serviceability for this product, this service has a special
contract with the Application Runtime Expert. The runtime guarantees that this service will always
be the very first service started. What this means is that the LoggingService
is
guaranteed to be available for use by all services and plugins, regardless of when they are
discovered or instantiated by the runtime.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT
Copyright for class bytecode |
Fields inherited from class com.ibm.are.service.BaseSingletonService |
---|
serviceData |
Constructor Summary | |
---|---|
LoggingService()
Default constructor |
Method Summary | |
---|---|
java.util.logging.Logger |
createLogger(java.lang.String packageName,
java.lang.String logFileName)
Creates a customized logger based on the input parameters. |
java.util.logging.Logger |
createLogger(java.lang.String packageName,
java.lang.String logFileName,
int maxSize,
int maxNumber)
Creates a customized logger based on the input parameters. |
java.lang.String |
getCommonName()
|
java.lang.String |
getDescription()
|
java.util.logging.Logger |
getGlobalLogger()
Retrieves a reference to the global logger |
Version |
getVersion()
|
protected void |
startImpl(java.util.List startArgs)
Starts the service. |
protected void |
stopImpl(java.util.List stopArgs)
Stops the service. |
Methods inherited from class com.ibm.are.service.BaseSingletonService |
---|
getElementData, setElementData, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.are.service.Service |
---|
start, stop |
Methods inherited from interface com.ibm.are.core.Element |
---|
getElementData, setElementData |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public LoggingService()
Method Detail |
---|
protected void startImpl(java.util.List startArgs)
startImpl
in class BaseSingletonService
startArgs
- Start arguments. Currently no start arguments are defined for this service.protected void stopImpl(java.util.List stopArgs)
stopImpl
in class BaseSingletonService
stopArgs
- Start arguments. Currently no start arguments are defined for this service.public java.lang.String getCommonName()
getCommonName
in interface com.ibm.are.core.Element
public java.lang.String getDescription()
getDescription
in interface com.ibm.are.core.Element
public Version getVersion()
getVersion
in interface com.ibm.are.core.Element
public java.util.logging.Logger getGlobalLogger()
public java.util.logging.Logger createLogger(java.lang.String packageName, java.lang.String logFileName)
packageName
- The package name will be used as the name of the loggerlogFileName
- The name of the log file
public java.util.logging.Logger createLogger(java.lang.String packageName, java.lang.String logFileName, int maxSize, int maxNumber)
packageName
- The package name will be used as the name of the loggerlogFileName
- The name of the output file used when writing log entriesmaxSize
- The maximum size, in bytes, of each log filemaxNumber
- The maximum number of log files to generate before re-using the oldest one
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |