version 1.46, 2006/11/03 18:31:40
|
version 1.47, 2006/11/08 20:38:30
|
|
|
#include "System.h" | #include "System.h" |
#include <Pegasus/Common/MessageLoader.h> //l10n | #include <Pegasus/Common/MessageLoader.h> //l10n |
| |
|
#if defined(PEGASUS_USE_SYSLOGS) |
|
# include <syslog.h> |
|
#endif |
|
|
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
|
|
| |
fileName = _allocLogFileName(homeDirectory, Logger::DEBUG_LOG); | fileName = _allocLogFileName(homeDirectory, Logger::DEBUG_LOG); |
_logs[Logger::DEBUG_LOG].open(fileName, ios::app); | _logs[Logger::DEBUG_LOG].open(fileName, ios::app); |
|
#else |
|
|
|
#ifdef PEGASUS_OS_ZOS |
|
logIdendity = System::CIMSERVER.getCString(); |
|
// If System Log is used open it |
|
System::openlog(logIdendity, LOG_PID, LOG_DAEMON); |
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
~LoggerRep() |
|
{ |
|
#if !defined(PEGASUS_USE_SYSLOGS) |
|
_logs[Logger::TRACE_LOG].close(); |
|
_logs[Logger::STANDARD_LOG].close(); |
|
|
|
#ifndef PEGASUS_DISABLE_AUDIT_LOGGER |
|
_logs[Logger::AUDIT_LOG].close(); |
|
#endif |
|
|
|
_logs[Logger::ERROR_LOG].close(); |
|
_logs[Logger::DEBUG_LOG].close(); |
|
|
|
#else |
|
|
|
#ifdef PEGASUS_OS_ZOS |
|
System::closelog(); |
|
|
|
#endif |
|
|
#endif | #endif |
| |
} | } |
|
|
| |
private: | private: |
| |
|
#ifdef PEGASUS_OS_ZOS |
|
CString logIdendity; |
|
#endif |
ofstream _logs[int(Logger::NUM_LOGS)]; | ofstream _logs[int(Logger::NUM_LOGS)]; |
}; | }; |
| |