Package rrlog :: Package contrib :: Module catarch_dbsa :: Class MetatableCatArchiver
[hide private]
[frames] | no frames]

Class MetatableCatArchiver

source code

         object --+    
                  |    
catarch.CatArchiver --+
                      |
                     MetatableCatArchiver

Saves interesting log lines (i.e.rescues them from log rotation.)


Attention:
Instance Methods [hide private]
 
__init__(self, server, minArchCount, minClientArchCount, cats, maxCount, metaEngineStr=None, metatableName=None, metatableOverwrite=True)
The metatable is a secondary archive table with exactly one line per triggering msg (i.e.no preceding messages), an additional id (unique per triggering message) and less data columns.
source code
 
_writeMeta(self, trigger_id, clientid, msgid)
hook, override to write meta data (one line for each problem) #todo: inconsistent col names (suffixed by both "id" and "_id")
source code

Inherited from catarch.CatArchiver: observe

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, server, minArchCount, minClientArchCount, cats, maxCount, metaEngineStr=None, metatableName=None, metatableOverwrite=True)
(Constructor)

source code 

The metatable is a secondary archive table with exactly one line per triggering msg (i.e.no preceding messages), an additional id (unique per triggering message) and less data columns.

Parameters:
  • metatableOverwrite - Drop meta table if existing
  • metaEngineStr - SQLAlchemy engine string for meta table
  • minArchCount - >=1,default: 10. This is the count of messages that are at least archived along with any problem message (the problem message itself included.) Note 1: When a problem is archived shortly after another, no messages are saved twice even if the "preceding messages" intervals overlap. Note 2: The effective number of archived lines is limited by the cached jobs (job history) of the server. See LogServer parameters.
  • minClientArchCount - >=1, default: 1. This is analogous but addresses messages with the same client id as the "trigger message". The intention is that we often want to save more preceding messages that concern the "problematic" client only. Note: Unlike minArchCount, messages are archived twice when the "preceding messages" intervals overlap, i.e. when problems are logged shortly after each other.
  • cats - list of cat; I archive log entries when cat is in this list.Default is "E","I","S" (These are speaking keys that mean: Error,InternalError,SecurityIssue. Adapt it to the convention that your application uses.)
  • maxCount - max. problem count (== max size of the meta table). Subsequent problems are ignored.
Overrides: object.__init__

_writeMeta(self, trigger_id, clientid, msgid)

source code 

hook, override to write meta data (one line for each problem) #todo: inconsistent col names (suffixed by both "id" and "_id")

Overrides: catarch.CatArchiver._writeMeta
(inherited documentation)