#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 More... | |
void | setLogformat (const char *logformatName) |
configures formatting-related settings for the given logformat name More... | |
void | open () |
prepare for recording entries More... | |
void | rotate () |
handle the log rotation request More... | |
void | close () |
stop recording entries More... | |
Public Attributes | |
Logfile * | logfile = nullptr |
records writer More... | |
char * | filename = nullptr |
logging destination More... | |
ACLList * | aclList = nullptr |
restrict logging to matching transactions More... | |
Format::Format * | logFormat = nullptr |
custom log record template for type == Log::Format::CLF_CUSTOM More... | |
Log::Format::log_type | type = Log::Format::CLF_UNKNOWN |
log record template ID More... | |
size_t | bufferSize = 8*MAX_URL |
how much to buffer before dropping or dying (buffer-size=N) More... | |
std::optional< unsigned int > | rotationsToKeep |
how many log files to retain when rotating. Default: obey logfile_rotate More... | |
bool | fatal = true |
whether unrecoverable errors (e.g., dropping a log record) kill worker More... | |
Detailed Description
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.
Constructor & Destructor Documentation
◆ FormattedLog() [1/2]
|
default |
◆ ~FormattedLog()
FormattedLog::~FormattedLog | ( | ) |
Definition at line 21 of file FormattedLog.cc.
References aclDestroyAclList(), aclList, close(), filename, and safe_free.
◆ FormattedLog() [2/2]
|
delete |
Member Function Documentation
◆ close()
void FormattedLog::close | ( | ) |
Definition at line 166 of file FormattedLog.cc.
References logfile, and logfileClose().
Referenced by ~FormattedLog(), and Security::CloseLogs().
◆ dumpOptions()
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.
◆ open()
void FormattedLog::open | ( | ) |
Definition at line 150 of file FormattedLog.cc.
References bufferSize, fatal, filename, logfile, logfileOpen(), and Must.
Referenced by Security::OpenLogs().
◆ parseOptions()
void FormattedLog::parseOptions | ( | ConfigParser & | parser, |
const char * | defaultFormat | ||
) |
handles the [key=value...] part of the log configuration
- Parameters
-
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().
◆ rotate()
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().
◆ setLogformat()
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().
◆ usesDaemon()
bool FormattedLog::usesDaemon | ( | ) | const |
- Returns
- whether the daemon module is used for this log
Definition at line 30 of file FormattedLog.cc.
References filename.
Member Data Documentation
◆ aclList
ACLList* FormattedLog::aclList = nullptr |
Definition at line 61 of file FormattedLog.h.
Referenced by Security::KeyLog::KeyLog(), ~FormattedLog(), and Security::KeyLogger::shouldLog().
◆ bufferSize
Definition at line 70 of file FormattedLog.h.
Referenced by dumpOptions(), open(), and parseOptions().
◆ fatal
bool FormattedLog::fatal = true |
Definition at line 76 of file FormattedLog.h.
Referenced by dumpOptions(), open(), and parseOptions().
◆ filename
char* FormattedLog::filename = nullptr |
Definition at line 58 of file FormattedLog.h.
Referenced by Security::KeyLog::KeyLog(), ~FormattedLog(), open(), setLogformat(), and usesDaemon().
◆ logfile
Logfile* FormattedLog::logfile = nullptr |
Definition at line 55 of file FormattedLog.h.
Referenced by Security::KeyLog::canLog(), close(), open(), and rotate().
◆ logFormat
Format::Format* FormattedLog::logFormat = nullptr |
Definition at line 64 of file FormattedLog.h.
Referenced by Security::KeyLog::KeyLog(), dumpOptions(), and setLogformat().
◆ rotationsToKeep
std::optional<unsigned int> FormattedLog::rotationsToKeep |
Definition at line 73 of file FormattedLog.h.
Referenced by dumpOptions(), parseOptions(), and rotate().
◆ type
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().
The documentation for this class was generated from the following files:
- src/log/FormattedLog.h
- src/log/FormattedLog.cc