1 / 13

ACS Logging System APIs: C++

ACS Logging System APIs: C++. Bogdan Jeram (bjeram@eso.org) European Southern Observatory. July 2004. NRAO. Architecture. Application (non C++ & Java). ACS log SVC. Application (C++). Client jlog. Notification channel. Centralized logger (Telecom Log COS). L A o g

Download Presentation

ACS Logging System APIs: C++

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ACSLogging System APIs: C++ Bogdan Jeram (bjeram@eso.org) European Southern Observatory July 2004 NRAO

  2. Architecture Application(non C++ & Java) ACS log SVC Application (C++) Clientjlog Notificationchannel Centralizedlogger(Telecom Log COS) LA o g C g IE n g L o pg rg oI xn yg macro client macro client macro local cache - file macro stdout - screen ACS Logging System APIs: C++

  3. Logging System in C++ • based on ACE logging • defined callback (LoggingProxy) • defined macros • implementation of Centralized Log e.g. Telecom Log CORBA service • ACS Log SVCS ACS Logging System APIs: C++

  4. Initialisation • should be done in every thread ! • already done by the Container and the Simple client • LoggingProxy m_logger (cacheSize, minCachePrio, maxCachePrio);LoggingProxy::init (&m_logger); • additional configuration: host name, centralized logger, … • LoggingProxy::done(); ACS Logging System APIs: C++

  5. C++ log macros Generic: ACS_LOG (flag, routine, log) log:ACE log message: (log type, msg) ACS Logging System APIs: C++

  6. ACE log messages • Flags: • LM_RUNTIME_CONTEXT • LM_SOURCE_INFO • Log types and default priorities: • LM_TRACE (2) • LM_DEBUG (3) • LM_INFO (4) • LM_NOTICE (5) • LM_WARNING (6) • LM_ERROR (8) • LM_CRITICAL (9) • LM_ALERT (10) • LM_EMERGENCY (11) ACS Logging System APIs: C++

  7. C++ log macros Specialized: • ACS_DEBUG( routine, msg) • ACS_DEBUG_PARAM (routine, msg, param) • ACS_TRACE (routine) • ACS_SHORT_LOG (log) ACS Logging System APIs: C++

  8. Examples of creating a message • ACS_DEBUG("BaciTestClass::~BaciTestClass“, "COB destroyed“); • ACS_LOG(LM_RUNTIME_CONTEXT, "maci::ActivatorImpl::init", (LM_INFO, "Activator '%s' initialized successfuly", m_activator_name)); ACS Logging System APIs: C++

  9. Configuring • at construction time: LoggingProxy • via the Configuration Database:<Activator CacheSize="10“ MinCachePriority="0“ MaxCachePriority="31“ CentralizedLogger="Log"></Activator> • environment variables: • set the priority for sending logs to stdout: ACS_LOG_STDOUT • set the file for the local cache: ACS_LOG_FILE ACS Logging System APIs: C++

  10. ACS log service • ACS service • started with: acsStartORBSVC • access to the ACS logging system if native support for logging is not available • reference can be obtained via the Manager (ACSLogSvc) ACS Logging System APIs: C++

  11. IDL interface LogSvc void logTrace(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException); void logDebug(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException);void logInfo(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException);void logNotice(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException);void logWarning(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException);void logError(in ACSErr::ErrorTrace c) raises (ACSErr::ACSException);void logCritical(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException);void logAlert(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException);void logEmergency(in TimeStamp time, in string msg, in RTContext rtCont, in SourceInfo srcInfo, in NVPairSeq data) raises (ACSErr::ACSException);void logXML(in XMLstring xml) raises (ACSErr::ACSException); }; ACS Logging System APIs: C++

  12. References • Logging and Archiving:http://www.eso.org/~gchiozzi/AlmaAcs/OnlineDocs/Logging_and_Archiving.pdf • logging doxygen documentation:$ACSROOT/man/cpp/logging_8h.html • ACS Log SVCS doxygen documentation: $ACSROOT/man/idl/acslog_8idl.html ACS Logging System APIs: C++

  13. Exercises • Put into your example some log message: • trace messages: ACS_TRACE • debug message: ACS_DEBUG • try to replace ACS__TRACE/ACS_DEBUG with ACS_LOG (try different combination of flags) • play with environment variables: • ACS_LOG_STDOUT • ACS_LOG_FILE • try jlog log client ACS Logging System APIs: C++

More Related