#include <FormattedLog.h>

Inheritance diagram for FormattedLog:
Collaboration diagram for FormattedLog:

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

Logfilelogfile = nullptr
 records writer More...
char * filename = nullptr
 logging destination More...
ACLListaclList = nullptr
 restrict logging to matching transactions More...
Format::FormatlogFormat = 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 introtationsToKeep
 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]

FormattedLog::FormattedLog ( )

◆ ~FormattedLog()

FormattedLog::~FormattedLog ( )

Definition at line 21 of file FormattedLog.cc.

References aclDestroyAclList(), aclList, close(), filename, and safe_free.

◆ FormattedLog() [2/2]

FormattedLog::FormattedLog ( FormattedLog &&  )

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()

◆ 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

defaultFormatdefault 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 ( )

◆ setLogformat()

void FormattedLog::setLogformat ( const char *  logformatName)

◆ usesDaemon()

bool FormattedLog::usesDaemon ( ) const
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

◆ bufferSize

size_t FormattedLog::bufferSize = 8*MAX_URL

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

◆ 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

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:






Web Site Translations