a single tls_key_log directive configuration and logging handler More...
#include <KeyLog.h>
Public Member Functions | |
KeyLog (ConfigParser &) | |
bool | canLog () const |
whether record() preconditions are currently satisfied More... | |
void | record (const CommunicationSecrets &) |
writes a single (but multi-line) key log entry More... | |
void | dump (std::ostream &) const |
reproduces explicitly-configured squid.conf settings More... | |
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
Constructor & Destructor Documentation
◆ KeyLog()
|
explicit |
Definition at line 25 of file KeyLog.cc.
References FormattedLog::aclList, assert, SBuf::c_str(), Log::Format::CLF_NONE, FormattedLog::filename, FormattedLog::logFormat, ConfigParser::optionalAclList(), FormattedLog::parseOptions(), ConfigParser::token(), FormattedLog::type, and xstrdup.
Member Function Documentation
◆ canLog()
|
inline |
Definition at line 26 of file KeyLog.h.
References FormattedLog::logfile.
Referenced by Security::KeyLogger::shouldLog().
◆ close()
|
inherited |
Definition at line 166 of file FormattedLog.cc.
References FormattedLog::logfile, and logfileClose().
Referenced by FormattedLog::~FormattedLog(), and Security::CloseLogs().
◆ dump()
void Security::KeyLog::dump | ( | std::ostream & | os | ) | const |
Definition at line 59 of file KeyLog.cc.
References Acl::AllowOrDeny().
Referenced by Configuration::Component< T >::Print().
◆ dumpOptions()
|
inherited |
Definition at line 83 of file FormattedLog.cc.
References FormattedLog::bufferSize, Log::LogConfig::BuiltInFormatName(), Log::Format::CLF_CUSTOM, Log::Format::CLF_NONE, Log::Format::CLF_SQUID, Log::Format::CLF_UNKNOWN, FormattedLog::fatal, FormattedLog::logFormat, MAX_URL, Format::Format::name, FormattedLog::rotationsToKeep, and FormattedLog::type.
◆ open()
|
inherited |
Definition at line 150 of file FormattedLog.cc.
References FormattedLog::bufferSize, FormattedLog::fatal, FormattedLog::filename, FormattedLog::logfile, logfileOpen(), and Must.
Referenced by Security::OpenLogs().
◆ parseOptions()
|
inherited |
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, FormattedLog::bufferSize, cfg_directive, Debug::Extra(), FormattedLog::fatal, Here, ConfigParser::optionalKvPair(), parseBytesOptionValue(), FormattedLog::rotationsToKeep, FormattedLog::setLogformat(), ToSBuf(), and xatoui().
Referenced by KeyLog().
◆ record()
void Security::KeyLog::record | ( | const CommunicationSecrets & | secrets | ) |
Definition at line 38 of file KeyLog.cc.
References assert, SBufStream::buf(), CodeContext::Current(), logfile, logfileLineEnd(), logfileLineStart(), logfilePrintf(), Security::CommunicationSecrets::record(), SQUIDSBUFPH, and SQUIDSBUFPRINT.
Referenced by Security::KeyLogger::maybeLog().
◆ rotate()
|
inherited |
Definition at line 159 of file FormattedLog.cc.
References Config, SquidConfig::Log, FormattedLog::logfile, logfileRotate(), SquidConfig::rotateNumber, and FormattedLog::rotationsToKeep.
Referenced by Security::RotateLogs().
◆ setLogformat()
|
inherited |
Definition at line 127 of file FormattedLog.cc.
References assert, cfg_directive, Log::Format::CLF_CUSTOM, Log::Format::CLF_UNKNOWN, debugs, FormattedLog::filename, Log::LogConfig::FindBuiltInFormat(), Here, FormattedLog::logFormat, Log::TheConfig, ToSBuf(), and FormattedLog::type.
Referenced by FormattedLog::parseOptions().
◆ usesDaemon()
|
inherited |
- Returns
- whether the daemon module is used for this log
Definition at line 30 of file FormattedLog.cc.
References FormattedLog::filename.
Member Data Documentation
◆ aclList
|
inherited |
Definition at line 61 of file FormattedLog.h.
Referenced by KeyLog(), FormattedLog::~FormattedLog(), and Security::KeyLogger::shouldLog().
◆ bufferSize
Definition at line 70 of file FormattedLog.h.
Referenced by FormattedLog::dumpOptions(), FormattedLog::open(), and FormattedLog::parseOptions().
◆ fatal
|
inherited |
Definition at line 76 of file FormattedLog.h.
Referenced by FormattedLog::dumpOptions(), FormattedLog::open(), and FormattedLog::parseOptions().
◆ filename
|
inherited |
Definition at line 58 of file FormattedLog.h.
Referenced by KeyLog(), FormattedLog::~FormattedLog(), FormattedLog::open(), FormattedLog::setLogformat(), and FormattedLog::usesDaemon().
◆ logfile
|
inherited |
Definition at line 55 of file FormattedLog.h.
Referenced by canLog(), FormattedLog::close(), FormattedLog::open(), and FormattedLog::rotate().
◆ logFormat
|
inherited |
Definition at line 64 of file FormattedLog.h.
Referenced by KeyLog(), FormattedLog::dumpOptions(), and FormattedLog::setLogformat().
◆ rotationsToKeep
|
inherited |
Definition at line 73 of file FormattedLog.h.
Referenced by FormattedLog::dumpOptions(), FormattedLog::parseOptions(), and FormattedLog::rotate().
◆ type
|
inherited |
Definition at line 67 of file FormattedLog.h.
Referenced by KeyLog(), FormattedLog::dumpOptions(), and FormattedLog::setLogformat().
The documentation for this class was generated from the following files: