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

Logger::Logger (  ) 

Default constructor.

Initializes Logger with default values. Use setParameters() methos to overwrite them.

Definition at line 28 of file Logger.cpp.

Logger::~Logger (  ) 

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 
)

See also:
logGet()

Definition at line 299 of file Logger.cpp.

void Logger::logSetNumeric ( const string &  key,
const string &  spaceName,
unsigned  timeout 
)

See also:
logGet()

Definition at line 304 of file Logger.cpp.

void Logger::logIncrement ( const string &  key,
const string &  spaceName,
unsigned  step,
unsigned  timeout 
)

See also:
logGet()

Definition at line 309 of file Logger.cpp.

void Logger::logSaveSpace ( const string &  spaceName,
const string &  fileName 
)

See also:
logGet()

Definition at line 314 of file Logger.cpp.

void Logger::logLoadSpace ( const string &  spaceName,
const string &  fileName 
)

See also:
logGet()

Definition at line 319 of file Logger.cpp.

void Logger::logDestroySpace ( const string &  spaceName  ) 

See also:
logGet()

Definition at line 324 of file Logger.cpp.

void Logger::logCreateSpace ( const string &  spaceName,
const string &  userName,
unsigned  softQuota,
unsigned  hardQuota 
)

See also:
logGet()

Definition at line 329 of file Logger.cpp.

void Logger::logCleanSpace ( const string &  spaceName  ) 

See also:
logGet()

Definition at line 334 of file Logger.cpp.

void Logger::logSelectSpace ( const string &  spaceName  ) 

See also:
logGet()

Definition at line 339 of file Logger.cpp.

void Logger::logInitialize (  ) 

See also:
logGet()

Definition at line 344 of file Logger.cpp.

void Logger::logFinalize (  ) 

See also:
logGet()

Definition at line 349 of file Logger.cpp.

void Logger::logLogin ( const string &  userName  ) 

See also:
logGet()

Definition at line 354 of file Logger.cpp.

void Logger::logSoftQuotaExceeded ( const string &  spaceName  ) 

See also:
logGet()

Definition at line 359 of file Logger.cpp.

void Logger::logHardQuotaReached ( const string &  spaceName  ) 

See also:
logGet()

Definition at line 364 of file Logger.cpp.

void Logger::logLRUEntryRemoved ( const string &  key,
const string &  spaceName 
)

See also:
logGet()

Definition at line 369 of file Logger.cpp.

void Logger::logEntryTimedOut ( const string &  key,
const string &  spaceName 
)

See also:
logGet()

Definition at line 374 of file Logger.cpp.

void Logger::logQuotaUsedByUser ( const string &  userName,
unsigned  quota 
)

See also:
logGet()

Definition at line 379 of file Logger.cpp.

void Logger::logQuotaUsedBySpace ( const string &  spaceName,
unsigned  quota 
)

See also:
logGet()

Definition at line 384 of file Logger.cpp.

void Logger::logLoadConfig ( const string &  confDir,
unsigned  logLevel 
)

See also:
logGet()

Definition at line 389 of file Logger.cpp.

void Logger::logError ( const string &  error  ) 

See also:
logGet()

Definition at line 394 of file Logger.cpp.

void Logger::logClearStats ( const string &  spaceName  ) 

See also:
logGet()

Definition at line 399 of file Logger.cpp.

void Logger::logGCStartRun (  ) 

See also:
logGet()

Definition at line 404 of file Logger.cpp.

void Logger::logGCEndRun (  ) 

See also:
logGet()

Definition at line 409 of file Logger.cpp.

void Logger::logGCStartCollectingFromSpace ( const string &  spaceName  ) 

See also:
logGet()

Definition at line 414 of file Logger.cpp.

void Logger::logGCWalk ( const string &  message  ) 

See also:
logGet()

Definition at line 419 of file Logger.cpp.

void Logger::logTimeRecord ( const string &  discipline,
unsigned int  miliseconds 
)

See also:
logGet()

Definition at line 425 of file Logger.cpp.


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

Generated on Fri Jan 8 10:38:13 2010 for dreamcache by  doxygen 1.5.5