StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | List of all members
TxLogging::TxEventLogFile Class Reference
Inheritance diagram for TxLogging::TxEventLogFile:
TxLogging::TxEventLog TxLogging::TxEventLogCollector TxLogging::TxEventLogWeb

Public Member Functions

 TxEventLogFile ()
 
virtual ~TxEventLogFile ()
 
virtual void setEnvBrokerTaskID (const std::string &envBrokerTaskID)
 
virtual void setEnvBrokerJobID (const std::string &envBrokerJobID)
 
virtual void setBrokerTaskID (const std::string &brokerTaskID)
 
virtual void setBrokerJobID (int brokerJobID)
 
virtual void setRequesterName (const std::string &requester)
 
virtual void setContext (const std::string &context)
 
virtual void logStart (const std::string &key, const std::string &value)
 
virtual void logJobAttribute (const std::string &key, const std::string &value)
 
virtual void logJobSubmitLocation (const std::string &url)
 
virtual void setJobSubmitLocation (const std::string &url)
 
virtual void logJobSubmitState (State state)
 
virtual void setJobSubmitState (State state)
 
virtual void logTask (unsigned int size=1)
 
virtual void logTask (const std::string &taskAttributes)
 
virtual void logJobSubmitID (const std::string &ID)
 
virtual void setJobSubmitID (const std::string &ID)
 
virtual void logEvent (const std::string &logMsg, Level level=LEVEL_INFO, Stage stage=STATUS, const std::string &msgContext=TxUCMConstants::defaultContext)
 
virtual void logEvent (const std::string &userKey, const std::string &userValue, Level level=LEVEL_INFO, Stage stage=STATUS, const std::string &msgContext=TxUCMConstants::defaultContext)
 
virtual void logEnd (const std::string &key, const std::string &value)
 
- Public Member Functions inherited from TxLogging::TxEventLog
virtual ~TxEventLog ()
 
void setEnvBrokerTaskID (const char *envBrokerTaskID)
 
void setEnvBrokerJobID (const char *envBrokerJobID)
 
void setBrokerTaskID (const char *brokerTaskID)
 
void setRequesterName (const char *requester)
 
void setContext (const char *context)
 
void logStart (const char *key=TxUCMConstants::appStart, const char *value="application started")
 
void logJobSubmitLocation (const char *url)
 
void setJobSubmitLocation (const char *url)
 
void logJobAttribute (const char *key, const char *value)
 
void logTask (const char *taskAttributes)
 
void logJobSubmitID (const char *ID)
 
void setJobSubmitID (const char *ID)
 
void logEvent (const char *logMsg, Level level=LEVEL_INFO, Stage stage=STATUS, const char *msgContext=TxUCMConstants::defaultContext)
 
void logEvent (const char *userKey, const char *userValue, Level level=LEVEL_INFO, Stage stage=STATUS, const char *msgContext=TxUCMConstants::defaultContext)
 
void logEnd (const char *key=TxUCMConstants::appEnd, const char *value="application ended")
 

Protected Member Functions

virtual void writeDown (const std::string &message)
 
virtual void writeDown (const char *message)
 
- Protected Member Functions inherited from TxLogging::TxEventLog
 TxEventLog ()
 

Additional Inherited Members

- Public Types inherited from TxLogging::TxEventLog
enum  Stage { START = 1, STATUS = 2, END = 3 }
 
enum  Level {
  LEVEL_UNKNOWN = 0, LEVEL_TRACE = 1, LEVEL_DEBUG = 2, LEVEL_INFO = 3,
  LEVEL_NOTICE = 4, LEVEL_WARNING = 5, LEVEL_ERROR = 6, LEVEL_CRITICAL = 7,
  LEVEL_ALERT = 8, LEVEL_FATAL = 9, TOTAL_LEVELS
}
 
enum  State {
  UNKNOWN = 0, UNSUBMITTED = 1, STAGEIN = 2, PENDING = 3,
  ACTIVE = 4, SUSPENDED = 5, STAGEOUT = 6, CLEANUP = 7,
  DONE = 8, FAILED = 9, TOTAL_STATES
}
 

Detailed Description

Definition at line 30 of file TxEventLogFile.h.

Constructor & Destructor Documentation

TxLogging::TxEventLogFile::TxEventLogFile ( )

Constructor

  • Gets hostname and sets nodeLocation for the running job.
virtual TxLogging::TxEventLogFile::~TxEventLogFile ( )
virtual

Destructor:

  • Sets job state to finished (STAGE = END)

Member Function Documentation

virtual void TxLogging::TxEventLogFile::logEnd ( const std::string &  key,
const std::string &  value 
)
virtual

Called by the application to log an END event

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::logEvent ( const std::string &  logMsg,
Level  level = LEVEL_INFO,
Stage  stage = STATUS,
const std::string &  msgContext = TxUCMConstants::defaultContext 
)
virtual

Log a simple message event. This event is always associated with the currnet brokerTaskID and brokerJobID.

Parameters
logMsgThe message to log.
levelThe level of severity of the event.
stageThe stage of the application assocated with the event.
msgContextThe context in which the event occurs.

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::logEvent ( const std::string &  userKey,
const std::string &  userValue,
Level  level = LEVEL_INFO,
Stage  stage = STATUS,
const std::string &  msgContext = TxUCMConstants::defaultContext 
)
virtual

Log a key-value pair type event. This event is always associated with the current brokerTaskID and brokerJobID.

Parameters
userKey,Thekey of the key-value to log.
userValue,Thevalue of the key-value to log.
levelThe level of severity of the event.
stageThe stage of the application assocated with the event.
msgContextThe context in which the event occurs.

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::logJobAttribute ( const std::string &  key,
const std::string &  value 
)
virtual

Log the job attrbutes. This method will be called by the Broker.

Parameters
stringattrbutes key, For example: "que"
stringattrbutes value, For example queu name

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::logJobSubmitID ( const std::string &  ID)
virtual

Log the job submit ID. This method will be called by the Broker.

Parameters
stringID, Job submit ID.

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::logJobSubmitLocation ( const std::string &  url)
virtual

Log the job submit location. This method will be called by the Broker.

Parameters
stringurl, Job submit location.

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::logJobSubmitState ( State  state)
virtual

Log the job state. This method will be called by the Broker.

Parameters
enumStage, Job state.

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::logStart ( const std::string &  key,
const std::string &  value 
)
virtual

Called by the application to log a START event

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::logTask ( unsigned int  size = 1)
virtual

Log the task size. This method will be called by the Broker to log the new task and its size.

Parameters
intsize, The new task size (the total number of the jobs)

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::logTask ( const std::string &  taskAttributes)
virtual

Log the task with the attributes. This method will be called by the Broker to log the new task and its attributes. The attribuites MUST match the "Task" MySQL table column names. The attribute types must match the mySql Task table column types

Parameters
stringattributes. Task attributes

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::setBrokerJobID ( int  brokerJobID)
virtual

The concept of a job ID and task ID assigned by broker is assumed to be available here. Set the value of Job ID here.

Parameters
intbrokerJobID, value of Job ID

Implements TxLogging::TxEventLog.

Reimplemented in TxLogging::TxEventLogCollector.

virtual void TxLogging::TxEventLogFile::setBrokerTaskID ( const std::string &  brokerTaskID)
virtual

The concept of a job ID and task ID assigned by broker is assumed to be available here. Set the value of Task ID here.

Parameters
stringbrokerTaskID, value of Task ID

Implements TxLogging::TxEventLog.

Reimplemented in TxLogging::TxEventLogCollector.

virtual void TxLogging::TxEventLogFile::setContext ( const std::string &  context)
virtual

Set context for this task/job

Parameters
context,themessage context

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::setEnvBrokerJobID ( const std::string &  envBrokerJobID)
virtual

The concept of a job ID and task ID assigned by broker is assumed to be available here. Set the job ID by passing the name of the environment variable

Parameters
stringenvBrokerJobID, Name of the environment variable

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::setEnvBrokerTaskID ( const std::string &  envBrokerTaskID)
virtual

The concept of a job ID and task ID assigned by broker is assumed to be available here. Set the task ID by passing the name of the environment variable

Parameters
stringenvBrokerTaskID, Name of the environment variable

Implements TxLogging::TxEventLog.

virtual void TxLogging::TxEventLogFile::setRequesterName ( const std::string &  requester)
virtual

Set the requester name

Parameters
stringrequesterName

Implements TxLogging::TxEventLog.

Reimplemented in TxLogging::TxEventLogCollector.

virtual void TxLogging::TxEventLogFile::writeDown ( const std::string &  message)
protectedvirtual

Write down the prepared plain message using the concete media

Parameters
stringmessage , Message to be written out

Implements TxLogging::TxEventLog.

Reimplemented in TxLogging::TxEventLogCollector, and TxLogging::TxEventLogWeb.


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