RAVE
|
Classes | |
class | LogRecordSocketReceiver |
Simple TCP socket-based logging receiver suitable for testing, and maybe a little more. More... | |
class | LogRecordStreamHandler |
Handler for a streaming logging request. More... | |
class | rave_pgf_logger_server |
Functions | |
init_logger (logger, level=LOGLEVEL, logfile=LOGFILE) | |
Initializes the system logger. | |
log (logger, level, msg) | |
Locks, logs, and unlocks, with rudimentary level filtering. | |
rave_pgf_logger_client (host=PGF_HOST, port=LOGPORT, level=LOGLEVEL) | |
Client logger. | |
rave_pgf_syslog_client (name=LOGID, address=SYSLOG, facility=LOGFACILITY, level=LOGLEVEL) | |
SysLog client. | |
rave_pgf_stdout_client (name="RAVE-STDOUT", level=LOGLEVEL) | |
stdout client. | |
rave_pgf_logfile_client (name="RAVE-LOGFILE", level=LOGLEVEL, logfile=LOGFILE, logfilesize=LOGFILESIZE, nrlogfiles=LOGFILES) | |
create_logger (level=LOGLEVEL, name=None) | |
Variables | |
dict | LOGLEVELS |
tempdir | |
str | prog = "rave_pgf_logger_server" |
str | usage = "usage: %s start|stop|status|restart|fg" % prog |
ARG = sys.argv[1].lower() | |
this = rave_pgf_logger_server() | |
myLogger = rave_pgf_syslog_client() | |
Copyright (C) 2010- Swedish Meteorological and Hydrological Institute (SMHI) This file is part of RAVE. RAVE is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. RAVE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with RAVE. If not, see <http://www.gnu.org/licenses/>.
Lib.rave_pgf_logger.init_logger | ( | logger, | |
level = LOGLEVEL, | |||
logfile = LOGFILE ) |
Initializes the system logger.
logger | an instance returned by logging.getLogger() |
level | int log level |
Lib.rave_pgf_logger.log | ( | logger, | |
level, | |||
msg ) |
Locks, logs, and unlocks, with rudimentary level filtering.
logger | the logger object initialized with init_logger() |
level | string log level |
msg | string log message |
Lib.rave_pgf_logger.rave_pgf_logger_client | ( | host = PGF_HOST, | |
port = LOGPORT, | |||
level = LOGLEVEL ) |
Client logger.
Clients can be created even when the server isn't running. They will succeed in connecting and logging when the server starts, even though messages will be lost before this is done. The only time this could happen is when the PGF and logger servers are initializing, and the client loggers in the PGF server send messages before the logger server is ready, which is highly unlikely.
host | URI to the host for this server. |
port | int port number to the host for this server. |
level | string log level |
Lib.rave_pgf_logger.rave_pgf_stdout_client | ( | name = "RAVE-STDOUT", | |
level = LOGLEVEL ) |
stdout client.
level | string log level |
Lib.rave_pgf_logger.rave_pgf_syslog_client | ( | name = LOGID, | |
address = SYSLOG, | |||
facility = LOGFACILITY, | |||
level = LOGLEVEL ) |
SysLog client.
It is up to the user to figure out how to sort/filter syslog messages. The level of the messages actually appearing in syslog will be determined by the level set by your host, and changing this may require root access.
name | string logger identifier. This will look up a logger that is already initialized after it has been initialized the first time, normally when the PGF server starts. |
address | tuple containing (string, int) for (host, port) or the device file containing the socket used for syslog. |
facility | string representing the syslog facility |
level | string log level |
dict Lib.rave_pgf_logger.LOGLEVELS |