|
Squid Web Cache master
|
#include <FormattedLog.h>
Public Member Functions | |
| FormattedLog ()=default | |
| ~FormattedLog () | |
| FormattedLog (FormattedLog &&)=delete | |
| bool | usesDaemon () const |
| void | parseOptions (ConfigParser &, const char *defaultFormat) |
| void | dumpOptions (std::ostream &os) const |
| reports explicitly-configured key=value options, in squid.conf format | |
| void | setLogformat (const char *logformatName) |
| configures formatting-related settings for the given logformat name | |
| void | open () |
| prepare for recording entries | |
| void | rotate () |
| handle the log rotation request | |
| void | close () |
| stop recording entries | |
Public Attributes | |
| Logfile * | logfile = nullptr |
| records writer | |
| char * | filename = nullptr |
| logging destination | |
| ACLList * | aclList = nullptr |
| restrict logging to matching transactions | |
| Format::Format * | logFormat = nullptr |
| custom log record template for type == Log::Format::CLF_CUSTOM | |
| Log::Format::log_type | type = Log::Format::CLF_UNKNOWN |
| log record template ID | |
| size_t | bufferSize = 8*MAX_URL |
| how much to buffer before dropping or dying (buffer-size=N) | |
| std::optional< unsigned int > | rotationsToKeep |
| how many log files to retain when rotating. Default: obey logfile_rotate | |
| bool | fatal = true |
| whether unrecoverable errors (e.g., dropping a log record) kill worker | |
A single-destination, single-record-format log. The customizable destination is based on Logfile "logging modules" API. Some logs allow the admin to select or specify the record format.
Definition at line 24 of file FormattedLog.h.
|
default |
| FormattedLog::~FormattedLog | ( | ) |
Definition at line 21 of file FormattedLog.cc.
References aclDestroyAclList(), aclList, close(), filename, and safe_free.
|
delete |
| void FormattedLog::close | ( | ) |
Definition at line 166 of file FormattedLog.cc.
References logfile, and logfileClose().
Referenced by ~FormattedLog(), and Security::CloseLogs().
| void FormattedLog::dumpOptions | ( | std::ostream & | os | ) | const |
Definition at line 83 of file FormattedLog.cc.
References bufferSize, Log::LogConfig::BuiltInFormatName(), Log::Format::CLF_CUSTOM, Log::Format::CLF_NONE, Log::Format::CLF_SQUID, Log::Format::CLF_UNKNOWN, fatal, logFormat, MAX_URL, Format::Format::name, rotationsToKeep, and type.
| void FormattedLog::open | ( | ) |
Definition at line 150 of file FormattedLog.cc.
References bufferSize, fatal, filename, logfile, logfileOpen(), and Must.
Referenced by Security::OpenLogs().
| void FormattedLog::parseOptions | ( | ConfigParser & | parser, |
| const char * | defaultFormat | ||
| ) |
handles the [key=value...] part of the log configuration
| defaultFormat | default logformat or, to force built-in format, nil |
Definition at line 36 of file FormattedLog.cc.
References assert, bufferSize, cfg_directive, Debug::Extra(), fatal, Here, ConfigParser::optionalKvPair(), parseBytesOptionValue(), rotationsToKeep, setLogformat(), ToSBuf(), and xatoui().
Referenced by Security::KeyLog::KeyLog().
| void FormattedLog::rotate | ( | ) |
Definition at line 159 of file FormattedLog.cc.
References Config, SquidConfig::Log, logfile, logfileRotate(), SquidConfig::rotateNumber, and rotationsToKeep.
Referenced by Security::RotateLogs().
| void FormattedLog::setLogformat | ( | const char * | logformatName | ) |
Definition at line 127 of file FormattedLog.cc.
References assert, cfg_directive, Log::Format::CLF_CUSTOM, Log::Format::CLF_UNKNOWN, debugs, filename, Log::LogConfig::FindBuiltInFormat(), Here, logFormat, Log::TheConfig, ToSBuf(), and type.
Referenced by parseOptions().
| bool FormattedLog::usesDaemon | ( | ) | const |
Definition at line 30 of file FormattedLog.cc.
References filename.
| ACLList* FormattedLog::aclList = nullptr |
Definition at line 61 of file FormattedLog.h.
Referenced by Security::KeyLog::KeyLog(), ~FormattedLog(), and Security::KeyLogger::shouldLog().
Definition at line 70 of file FormattedLog.h.
Referenced by dumpOptions(), open(), and parseOptions().
| bool FormattedLog::fatal = true |
Definition at line 76 of file FormattedLog.h.
Referenced by dumpOptions(), open(), and parseOptions().
| char* FormattedLog::filename = nullptr |
Definition at line 58 of file FormattedLog.h.
Referenced by Security::KeyLog::KeyLog(), ~FormattedLog(), open(), setLogformat(), and usesDaemon().
| Logfile* FormattedLog::logfile = nullptr |
Definition at line 55 of file FormattedLog.h.
Referenced by Security::KeyLog::canLog(), close(), icapLogOpen(), open(), and rotate().
| Format::Format* FormattedLog::logFormat = nullptr |
Definition at line 64 of file FormattedLog.h.
Referenced by Security::KeyLog::KeyLog(), dumpOptions(), and setLogformat().
| std::optional<unsigned int> FormattedLog::rotationsToKeep |
Definition at line 73 of file FormattedLog.h.
Referenced by dumpOptions(), parseOptions(), and rotate().
| Log::Format::log_type FormattedLog::type = Log::Format::CLF_UNKNOWN |
Definition at line 67 of file FormattedLog.h.
Referenced by Security::KeyLog::KeyLog(), dumpOptions(), and setLogformat().