Service Grid Logging

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Summary: Loggers and logger configuration with the Service Grid is done by extending Java Logging capabilities

Using Dynamic Logger Configuration

The LoggerConfig mechanism (org.jini.rio.log.LoggerConfig; see Javadoc) has been provided for dynamic services (ServiceBeans) can specify named Logger attributes (Levels, Handlers, etc...) in runtime without depending on logger.properties attributes and values to be set.

Using the Logging element in the OperationalString Document

<Logging>
    <Logger Name="examples.hello" Level="ALL">
            <Handler ClassName="java.util.logging.ConsoleHandler" Level="ALL"/>
    </Logger>
</Logging>

If we were to choose a java.util.FileHandler as the Handler the declaration would be as follows:

<Logging>
   <Logger Name="examples.hello" Level="ALL">
       <Handler ClassName="java.util.logging.FileHandler" Level="ALL">
            <Parameters>
               <Parameter Name="java.lang.String" Value="${user.name}/hello%u.log"/>
               <Parameter Name="boolean" Value="true"/>
            </Parameters>
            <Formatter ClassName="java.util.logging.SimpleFormatter"/>
       </Handler>
    </Logger>
</Logging>

Note the use of ${user.name}. This value refers to the value of a system property by using the syntax ${propertyName} within the Value literal. The ${user.name} property gets resolved as the user's account name that is running the JVM the service is instantiated within.

Using LoggerConfig in a Configuration File

import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import org.jini.rio.log.LoggerConfig;

com.foo {    ...
    loggerConfigs = new LoggerConfig[] {
        new LoggerConfig("com.foo",
                       Level.ALL,
                       false,
                       new LogHandlerConfig[]{
                          new LogHandlerConfig(new ConsoleHandler(), Level.FINE)
                         })
    };
...
}

How the LoggerConfig Gets Created

As part of the ServiceBean instantiation process the LoggerConfig object (if included in the ServiceBean's ServiceBeanConfig object) will be instantiated by GSC infrastructure elements, created the desired Logger configuration (it should be noted that if the Logger already exists, the Level of the Logger being requested using the LogerConfig mechanisms will only be set if the the Level is less then the current Level).

The service can get the named Logger using normal mechanisms (Logger.getLogger("logger-name")).

Loggers

The ServiceGrid module uses a number of different Logger components. Each logger component along with what gets logged is listed below:

Logger Name Description
com.gigaspaces.admin.cli Command Line Interface (CLI) environment setup, OptionHandler creation.
The CLI additionally creates a log file called gs.log in the ServiceGrid/logs directory.
All system.err is redirected to this file.
The declared Logger uses the Level.CONFIG level for logging.
com.gigaspaces.ant Ant system initialization,
Ant file download statistics, temporary file creation and removal and exception stacktraces.
com.gigaspaces.grid.bean SpringBeanFactory loading of configured application context (Level.FINE)
com.gigaspaces.grid.gsc Adaptive class annotator, Grid Service Container logging
com.gigaspaces.grid.gsm Grid Service Monitor logging
com.gigaspaces.grid.lookup Autonomic lookup service handling
com.gigaspaces.grid.master Logging for the master in the bilt-in master worker framework
com.gigaspaces.grid.space.GigaSpacesFaultDetectionHandler Fault detection handler logging
com.gigaspaces.grid.space Space Association Management, GS Context, Space Handler
com.gigaspaces.grid.worker GigaSpaceStationImpl, TaskWorker
com.gigaspaces.management.system.cpu CPU, WindowsCPUHandler
com.gigaspaces.management.system.disk DiskSpace, WindowsDiskHandler
com.gigaspaces.management.system.memory Memory monitor logging, creation and reporting
com.gigaspaces.management SystemCapabilities
com.gigaspaces.start Configuration Parser, SystemBoot, SystemConfig
org.jini.rio.associations Creating and discovering declared Associations,
and controlling ServiceBean
advertise and unadvertise behavior based on Association state transitions
org.jini.rio.boot ServiceBean bootstrapping mechanisms
org.jini.rio.event EventConsumer and EventProducer details, event statistics
org.jini.rio.jsb ServiceBean state transitions, exporter
org.jini.rio.log Getting LoggerConfig
org.jini.rio.opstring OperationalString parsing
org.jini.rio.qos Compute Resource Platform and Measurable Capabilities, SLA Management and Thresholds
org.jini.rio.qos.RelocationPolicyHandler RelocationPolicyHandler initialization and threshold processing
org.jini.rio.qos.ScalingPolicyHandler ScalingPolicyHandler initialization and threshold processing
org.jini.rio.resources.client JiniClient processing
org.jini.rio.resources.client.HeartbeatFaultDetectionHandler HeartbeatFaultDetectionHandler processing
org.jini.rio.resources.client.StandardFaultDetectionHandler StandardFaultDetectionHandler processing
org.jini.rio.resources.resource Resource pools, Thread pools
org.jini.rio.resources.servicecore Core service framework, Lease management
org.jini.rio.cybernode Cybernode processing,
Provision Monitor discovery and Provision Monitor Lease renewal management,
Cybernode SLA Threshold Management, Cybernode Environment
org.jini.rio.monitor Provision Monitor creation, OperationalString Manager transitions, ServiceElement manager transitions, ServiceBean provisioning, reaction to fault detection and recovery of ServiceBean instances
org.jini.rio.monitor.feedback Information related to the feedback of Grid Service Containers, updating their qualitative and quantitative status
org.jini.rio.monitor.provision
Logging of provision attaempts and GSC supportability of declared service requirements
org.jini.rio.monitor.services Service management and monitoring for specific service elements in a deployment
org.jini.rio.monitor.sbi Logging of ServiceBean instanceID management
org.jini.rio.tools.webster Webster processing. Note that the definition of of the system property "webster.debug" will also result in logging messages to be sent to standard out
org.jini.rio.watch Watch creation, ThresholdHandler processing, Watch and ThresholdHandler associations

RELATED TOPICS

Declaring Elements Globally in Deployment Descriptor
Declaring Service UI in Deployment Descriptor
Deployment Descriptor Codebase Element
Deployment Descriptor DeploymentSchedule Element
Deployment Descriptor Parameters and Configuration Elements
Deployment Descriptor SharedComponent Element
Deployment Descriptor SLA Element
deploy - Service Grid CLI
Fixed and Dynamic ServiceBean ProvisionType
Injecting Deployment Descriptor Properties into POJOs
POJO Lifecycle in Service Grid
Proactive Cache
redeploy - Service Grid CLI
Rio OperationalString
Service Associations
Service Deployment Descriptor
Service Grid ClassLoader Hierarchy
undeploy - Service Grid CLI
Using Service Grid to Deploy Partitioned Space
Using Service Grid to Deploy Partitioned Space with Backup
Using Service Grid to Deploy Replicated Space
Using Service Grid to Deploy Space
Using Service Grid to Deploy Spring Applications
Using System Properties for Deployment Descriptor Element Values

Wiki Content Tree


Your Feedback Needed!

We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.

Labels

 
(None)