Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

LWLoggingPostORBInitCommand Class Reference
[LWLogging Producer Client]

#include <LWLoggingPostORBInitCommand.h>

Inheritance diagram for LWLoggingPostORBInitCommand:

Inheritance graph
[legend]
Collaboration diagram for LWLoggingPostORBInitCommand:

Collaboration graph
[legend]
List of all members.

Detailed Description

Client initializer for Lightweight Logging service.

Use this class to initialize the logging service for a Lightweight Logging Service client. The LWLoggingPostORBInitCommand is a wrapper for the LogProducer interface. Install an instance of this class into BoilerPlate's OrbInit as a PostORBInitCommand using ORBInit::addPostORBInitCommand.

The LWLoggingPostORBInitCommand requires an initialized ORB because this Log client uses the NameService to locate the bound referenc of the LogProducer interface. ORBInit uses the LWLoggingPostORBInitCommand::execute operation to pass the ORB.

A client LogProducer has a Producer Id which is set in the ctor or in the execute operation. Once set the Producer Id is immutable. The producer id appears in the Log Service log. It is passed to the Log Service on each invocation along with a Producer Name. The Producer Id identifies the application and the Producer Name identifies the unit of execution that creates the log message. For example, an application has a Producer Id of TheApplication. If TheApplication has a class Foo with an operation doSomething, then the Producer name might be Foo::doSomething.

Classes using this implementation of BPLog are not aware that they are actually talking to CORBA. Log clients use a reference to a BPLog that is acquired by calling the static BPLog::log. CORBA semantics do not leak into the business logic. Developers can interchange the LWLogging PostORBInitCommand and the BPLoggingStub without changing the code that interfaces with the Log. The LWLoggingPostORBInitCommand intercepts the call and translates the message into the correct CORBA structures defined by the CosLW_Log IDL.

Note:
The reference to the BPLog returned by BPLog::log is not valid until the PostORBInitCommand::execute operation has been called. You can use BPLog::log in your implementations of ServantFactory::build where it will be valid. Using BPLog::log before that time will result in undefined behavior because the log reference has not been initialized.
Command Line Options


Public Member Functions

 LWLoggingPostORBInitCommand (const char *producer_name)
 LWLoggingPostORBInitCommand ()
virtual ~LWLoggingPostORBInitCommand ()
virtual bool execute (CORBA::ORB_ptr orb, ConfMap &config_map)
virtual void logSecurityAlarm (const char *producerId, const char *msg)
virtual void logFailureAlarm (const char *producerId, const char *msg)
virtual void logDegradedAlarm (const char *producerId, const char *msg)
virtual void logExceptionError (const char *producerId, const char *msg)
virtual void logFlowControlError (const char *producerId, const char *msg)
virtual void logRangeError (const char *producerId, const char *msg)
virtual void logUsageError (const char *producerId, const char *msg)
virtual void logAdministrativeEvent (const char *producerId, const char *msg)
virtual void logStatisticReport (const char *producerId, const char *msg)
virtual void logDebugReport (const char *producerId, const char *msg, unsigned short debuglevel=10)

Static Public Member Functions

BPLoglog ()

Protected Member Functions

void log (BPLog *log)


Constructor & Destructor Documentation

LWLoggingPostORBInitCommand::LWLoggingPostORBInitCommand const char *  producer_name  ) 
 

Initialize the Logging client

Initialize the Logging client subsystem. Initialization does not contact the LWL Service. It only sets the producer name

Parameters:
producer_name - The name of the producer. This name will appear in the log messsages written by the service.

LWLoggingPostORBInitCommand::LWLoggingPostORBInitCommand  ) 
 

Initialize the Logging client

Initialize the Logging client subsystem. Initialization does not contact the LWL Service.

virtual LWLoggingPostORBInitCommand::~LWLoggingPostORBInitCommand  )  [virtual]
 

DTOR


Member Function Documentation

virtual bool LWLoggingPostORBInitCommand::execute CORBA::ORB_ptr  orb,
ConfMap &  config_map
[virtual]
 

Covers the PostORBInitCommandContract

Called by BoilerPlate's OrbInit during CORBA initialization after the ORB has been initialized. The config_map is used to get the LogProducer reference from the NamingService. Use -BPlogproducertree=<the/log/producer/tree/objname>. The context tree should be documented in the BP-LWL Service start script.

Parameters:
orb - The initialized orb
config_map - ORBInit's configuration map. Used to get the string representing the NS Context tree where the BP-LWL LogProducer binds itself.
Note:
Set the NS Context using
-BPlogproducertree=<the_base/logid/Producer
The value defines the complete tree including the producer name.
Producer
is consistent and used for any Producer binding.
Returns:
bool

void BPLog::log BPLog log  )  [inline, protected, inherited]
 

Set the static Log pointer

Used by the implementation to set the pointer to the Log

Parameters:
log - The pointer to the Log implementation

BPLog& BPLog::log  )  [inline, static, inherited]
 

Obtain the interface to the log

Producer Clients obtain a reference to the Logging mechanism by calling BPLog::log().

Note:
The reference is not valid until after the ORB has been initialized.

virtual void LWLoggingPostORBInitCommand::logAdministrativeEvent const char *  producerId,
const char *  msg
[virtual]
 

Log an Administrative event

An administrative event includes events like startup and shutdown. It also includes requests that change the application's configuration

Parameters:
producerId - the name of the producer
msg - The message to log

Implements BPLog.

virtual void LWLoggingPostORBInitCommand::logDebugReport const char *  producerId,
const char *  msg,
unsigned short  debuglevel = 10
[virtual]
 

Log a debug message

A general debugging hook. The debuglevel parm must be greater than 9. If the debug level is less than 10, the operation will add 10 to the inbound level

Parameters:
producerId - the name of the producer
msg - The message to log
debuglevel - The debug level
Invariant:
debuglevel < 10 ? debuglevel += 10

debuglevel > 26 ? debuglevel = 26

Implements BPLog.

virtual void LWLoggingPostORBInitCommand::logDegradedAlarm const char *  producerId,
const char *  msg
[virtual]
 

Log a Degraded Alarm

A degraded alarm is raised when the system is in a state the inhibits it from performing at peak effeciency. For example, if the system can perform some of its functions but not all of its functions, it is in a degraded state.

Parameters:
producerId - the name of the producer
msg - The message to log

Implements BPLog.

virtual void LWLoggingPostORBInitCommand::logExceptionError const char *  producerId,
const char *  msg
[virtual]
 

Log an Exception Error

Use this operation to log exceptions as they are generated. Exceptions should be logged at points where they are generated, rethrown, or translated into new exception types. No information should be lost

Parameters:
producerId - the name of the producer
msg - The message to log

Implements BPLog.

virtual void LWLoggingPostORBInitCommand::logFailureAlarm const char *  producerId,
const char *  msg
[virtual]
 

Log a Failure Alarm

A Failure Alarm is raised when the application fails to create, find, or initialize an external service like a database connection, etc.

Parameters:
producerId - the name of the producer
msg - The message to log

Implements BPLog.

virtual void LWLoggingPostORBInitCommand::logFlowControlError const char *  producerId,
const char *  msg
[virtual]
 

Log a Flow control error

A flow control error occurs if a thread exhausts the control branches of a flow without falling into one of the branches.

Parameters:
producerId - the name of the producer
msg - The message to log

Implements BPLog.

virtual void LWLoggingPostORBInitCommand::logRangeError const char *  producerId,
const char *  msg
[virtual]
 

Log a Range Error

A Range Error occurs when a value is expected to be within a certain constraint but either exceeds or preceeds the range

Parameters:
producerId - the name of the producer
msg - The message to log

Implements BPLog.

virtual void LWLoggingPostORBInitCommand::logSecurityAlarm const char *  producerId,
const char *  msg
[virtual]
 

Log a security alarm

A security alarm is a notification that something has attempted to violate the application's security mechanism

Parameters:
producerId - the name of the producer
msg - The message to log

Implements BPLog.

virtual void LWLoggingPostORBInitCommand::logStatisticReport const char *  producerId,
const char *  msg
[virtual]
 

Log a statistic report

A statistic report includes messages about the applications performance and resources

Parameters:
producerId - the name of the producer
msg - The message to log

Implements BPLog.

virtual void LWLoggingPostORBInitCommand::logUsageError const char *  producerId,
const char *  msg
[virtual]
 

Log a Usage Error

Usage Errors include illegal argruments or arguments that would result in an illegal state

Parameters:
producerId - the name of the producer
msg - The message to log

Implements BPLog.


The documentation for this class was generated from the following file: