Logger Class Reference
Class that manages logging events related to the cache.
More...
#include <Logger.h>
List of all members.
|
Public Member Functions |
| Logger () |
| Default constructor.
|
void | setParameters (Settings config) |
| Sets logger parameters.
|
| ~Logger () |
| Destructor.
|
void | saveLogs () |
| Saves queued logs to the output.
|
void | operator() () |
| Logger thread main body.
|
void | logGet (const string &key, const string &spaceName) |
| EVENT LOGGING METHODS.
|
void | logSet (const string &key, const string &spaceName, unsigned timeout) |
void | logSetNumeric (const string &key, const string &spaceName, unsigned timeout) |
void | logIncrement (const string &key, const string &spaceName, unsigned step, unsigned timeout) |
void | logSaveSpace (const string &spaceName, const string &fileName) |
void | logLoadSpace (const string &spaceName, const string &fileName) |
void | logDestroySpace (const string &spaceName) |
void | logCreateSpace (const string &spaceName, const string &userName, unsigned softQuota, unsigned hardQuota) |
void | logCleanSpace (const string &spaceName) |
void | logSelectSpace (const string &spaceName) |
void | logInitialize () |
void | logFinalize () |
void | logLogin (const string &userName) |
void | logSoftQuotaExceeded (const string &spaceName) |
void | logHardQuotaReached (const string &spaceName) |
void | logLRUEntryRemoved (const string &key, const string &spaceName) |
void | logEntryTimedOut (const string &key, const string &spaceName) |
void | logQuotaUsedByUser (const string &userName, unsigned quota) |
void | logQuotaUsedBySpace (const string &spaceName, unsigned quota) |
void | logLoadConfig (const string &confDir, unsigned logLevel) |
void | logError (const string &error) |
void | logClearStats (const string &spaceName) |
void | logGCStartRun () |
void | logGCEndRun () |
void | logGCStartCollectingFromSpace (const string &spaceName) |
void | logGCWalk (const string &message) |
void | logTimeRecord (const string &discipline, unsigned int miliseconds) |
Static Public Attributes |
static bool | stop = 0 |
| flag used to stop the logging thread
|
Detailed Description
Class that manages logging events related to the cache.
Has methods that log asynchronously a various kinds of events. When we do not have permission to write to the directory given in the configuration Logger logs to standard output.
Definition at line 109 of file Logger.h.
Constructor & Destructor Documentation
Destructor.
If the Logger thread has been started it is killed here. All logs in the queue are logged.
Definition at line 33 of file Logger.cpp.
Member Function Documentation
void Logger::setParameters |
( |
Settings |
config |
) |
|
Sets logger parameters.
If the log directory is writable and logLevel is > 0 the appropriate log file is created and opened and the Logger thread is started (provided it has not beed started already - of course). It is not started/killed otherwise.
- Parameters:
-
| config | configuration settings to set |
Definition at line 60 of file Logger.cpp.
void Logger::operator() |
( |
|
) |
|
Logger thread main body.
Saves logs in the infinite loop
Definition at line 49 of file Logger.cpp.
void Logger::logGet |
( |
const string & |
key, |
|
|
const string & |
spaceName | |
|
) |
| | |
EVENT LOGGING METHODS.
For exapmle logGet() logs GET request.
All this methods are self-explanatory. In cases of confusion read the method name again ;)
Definition at line 294 of file Logger.cpp.
void Logger::logSet |
( |
const string & |
key, |
|
|
const string & |
spaceName, |
|
|
unsigned |
timeout | |
|
) |
| | |
void Logger::logSetNumeric |
( |
const string & |
key, |
|
|
const string & |
spaceName, |
|
|
unsigned |
timeout | |
|
) |
| | |
void Logger::logIncrement |
( |
const string & |
key, |
|
|
const string & |
spaceName, |
|
|
unsigned |
step, |
|
|
unsigned |
timeout | |
|
) |
| | |
void Logger::logSaveSpace |
( |
const string & |
spaceName, |
|
|
const string & |
fileName | |
|
) |
| | |
void Logger::logLoadSpace |
( |
const string & |
spaceName, |
|
|
const string & |
fileName | |
|
) |
| | |
void Logger::logDestroySpace |
( |
const string & |
spaceName |
) |
|
void Logger::logCreateSpace |
( |
const string & |
spaceName, |
|
|
const string & |
userName, |
|
|
unsigned |
softQuota, |
|
|
unsigned |
hardQuota | |
|
) |
| | |
void Logger::logCleanSpace |
( |
const string & |
spaceName |
) |
|
void Logger::logSelectSpace |
( |
const string & |
spaceName |
) |
|
void Logger::logInitialize |
( |
|
) |
|
void Logger::logFinalize |
( |
|
) |
|
void Logger::logLogin |
( |
const string & |
userName |
) |
|
void Logger::logSoftQuotaExceeded |
( |
const string & |
spaceName |
) |
|
void Logger::logHardQuotaReached |
( |
const string & |
spaceName |
) |
|
void Logger::logLRUEntryRemoved |
( |
const string & |
key, |
|
|
const string & |
spaceName | |
|
) |
| | |
void Logger::logEntryTimedOut |
( |
const string & |
key, |
|
|
const string & |
spaceName | |
|
) |
| | |
void Logger::logQuotaUsedByUser |
( |
const string & |
userName, |
|
|
unsigned |
quota | |
|
) |
| | |
void Logger::logQuotaUsedBySpace |
( |
const string & |
spaceName, |
|
|
unsigned |
quota | |
|
) |
| | |
void Logger::logLoadConfig |
( |
const string & |
confDir, |
|
|
unsigned |
logLevel | |
|
) |
| | |
void Logger::logError |
( |
const string & |
error |
) |
|
void Logger::logClearStats |
( |
const string & |
spaceName |
) |
|
void Logger::logGCStartRun |
( |
|
) |
|
void Logger::logGCEndRun |
( |
|
) |
|
void Logger::logGCStartCollectingFromSpace |
( |
const string & |
spaceName |
) |
|
void Logger::logGCWalk |
( |
const string & |
message |
) |
|
void Logger::logTimeRecord |
( |
const string & |
discipline, |
|
|
unsigned int |
miliseconds | |
|
) |
| | |
The documentation for this class was generated from the following files: