Log Server, Part of the log which can (optionally) be in a separate process. @author: Ruben Reifenberg
Bases: exceptions.Exception
A configured column name is impossible because already reserved.
Bases: object
This can (but must not be) in the application process. @cvar CAT_INTERNALERROR: Default “I”. This is used as “cat” when I write a log message about a logging failure (if possible)
Parameters: |
|
---|---|
Raises: |
|
file name in the configured format (cfnMode).
Returns: | String,men-Readable Callers File Name (None is name was None) |
---|---|
Parameters: | name – File file name incl. path, or None |
Bases: object
@ivar threadname: part of client identification @ivar msgid: int, id of the message. Unique in the client. @ivar msg: str, msg as created by the client. @ivar ts: str, timestamp @ivar special: dict with custom items (see “special” argument of the log method) @ivar tblen: len of the client traceback when the log method was called @ivar path: client traceback path as sequence of (filename, linenumber). [0] is the latest (where the log call happened)
Parameters: |
|
---|
Returns: | new instance with my init kwargs but updated with the given kwargs |
---|
Bases: exceptions.Exception
Attempt to add an observer twice into the observer list
Bases: object
Assigned to a list of LogWriters, rotates by creating a new one each time when a line count is exceeded. Maintains a history of old writers. @ivar writers: History of writers, current at [-1], oldest at [0]. Only writers with an existing (i.e.not already overwritten) table/file are available. (Migration note: This is analogous to the getWriteHistory() of version 0.1.1 but the order is ascending.)
Parameters: |
|
---|
@summary: DB Writing via SQLAlchemy (SA). @author: Ruben Reifenberg
Bases: rrlog.server.dbwriter_sa._Coltypes
Parameters: |
|
---|
Bases: object
USes SQLAlchemy (sa), Assigned to 1 Table
Default formatting method.
Return type: | {} |
---|---|
Returns: | {colname:fieldcontent} for a single row |
There is no primary key column; these are content columns only.
Returns: | [] of SQLAlchemy Column that make up my log table |
---|---|
Parameters: | colsConfig – (col-name:str,col-type,kwargs:dict) where col-type is DBConfig.Integer or DBConfig.String kwargs is optional and contains kwargs for Column() of sqlalchemy example: (“ipadress”,DBConfig.String,{“default”:”127.0.0.1”}) |
alias of DBLogWriter
Bases: object
Column types
Bases: sqlalchemy.types._DateAffinity, sqlalchemy.types.TypeEngine
A type for int integers.
Look for an attribute named “visit_” + self.__visit_name__ on the visitor, and call it with the same kw params.
Bases: sqlalchemy.types.Concatenable, sqlalchemy.types.TypeEngine
The base for all string and character types.
In SQL, corresponds to VARCHAR. Can also take Python unicode objects and encode to the database’s encoding in bind params (and the reverse for result sets.)
The length field is usually required when the String type is used within a CREATE TABLE statement, as VARCHAR requires a length on most databases.
Create a string-holding type.
Parameters: |
|
---|
Look for an attribute named “visit_” + self.__visit_name__ on the visitor, and call it with the same kw params.
Parameters: |
|
---|---|
Returns: | callable log object, ready to use |
Parameters: |
|
---|---|
Raises AssertionError: | |
when drop==False and rotateCount > 1 |
@summary: logging into text files. @author: Ruben Reifenberg
Bases: object
The specified log file was closed.
Bases: object
Describes a single log file. I.e.for log rotation, a sequence of this is required.
Parameters: |
|
---|
alias of FileLogWriter
Parameters: |
|
---|---|
Returns: | a Log ready to use |
Parameters: |
|
---|
@summary: Log to stdout. @author: Ruben Reifenberg
alias of PrintLogWriter
Parameters: |
|
---|---|
Returns: | a Log ready to use |
Parameters: |
|
---|
write(str) -> None. Write string str to file.
Note that due to buffering, flush() or close() may be needed before the file on disk reflects the data written.
Besides the thread(s) reading the socket, there is a single worker thread which feeds the log server. To stop the threaded server process (Ctrl-C prbably won’t work) use the specified module variables to regularly end it without log line loss, or kill the process.
Bases: SocketServer.TCPServer
simple TCP socket-based logging receiver suitable for testing.
Bases: SocketServer.StreamRequestHandler
Handler for a streaming logging request.
This basically logs the record using whatever logging policy is configured locally.
Loop which forever pops the oldest (left) element from the jobdataq and calls the log server. The global variable processq_stop=True ends the loop, but not before the jobdataq is found empty.
Run the given logServer as an xmlrpc server (forever). :param ports: sequence of portnumbers, at least one number. The first port available is used.
Multiple ports is for development, where sometimes ports may remain blocked. In production, better use a single port only, for best control over which server/client pairs are married.
@summary: Abstract base for text line logging. @author: Ruben Reifenberg
Bases: object
This resembles the L{logging.__init__.Formatter} of the Python Logging Package by using the same __init__ arguments. That allows conveniently replacing a formatter object of “one world” (standard logging resp. rrlog) with a formatter of the “other world”.
Initialize the formatter with specified format strings.
Initialize the formatter either with the specified format string, or a default as described above. Allow for specialized date formatting with the optional datefmt argument (if omitted, you get the ISO8601 format).
Bases: object
Abstract base class for text line writers
Parameters: | format_line – Callable, takes a job and returns a single message line as str. |
---|
See L{MsgJob} for job attributes available. See L{textwriter.Formatter.__call__} for an example.
@summary: The XML-RPC version of a LogServer connection. This is a slow way to log (mainly because of the unnecessary overhead of xml-rpc blocking calls), but simple and robust. Use it when the performance is good enough for you. @author: Ruben Reifenberg
Creates server that does no multithreading. Remark: The SimpleXMLRPCServer seems to do no multithreading, except we use MixIn class. Indeed, I found that a second client is blocked as long as the server is processing another request. (Python 2.4) :param ports: list or iterator of port numbers Multiple ports address the problem that a socket is for some time “already in use” when restarting the server. The first free port of the ports is used.