Squid Web Cache
master
Loading...
Searching...
No Matches
FormattedLog.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2025 The Squid Software Foundation and contributors
3
*
4
* Squid software is distributed under GPLv2+ license and includes
5
* contributions from numerous individuals and organizations.
6
* Please see the COPYING and CONTRIBUTORS files for details.
7
*/
8
9
#ifndef SQUID_SRC_LOG_FORMATTEDLOG_H
10
#define SQUID_SRC_LOG_FORMATTEDLOG_H
11
12
#include "
acl/forward.h
"
13
#include "
log/Formats.h
"
14
#include "
log/forward.h
"
15
16
#include <iosfwd>
17
#include <optional>
18
19
class
ConfigParser
;
20
24
class
FormattedLog
25
{
26
public
:
27
FormattedLog
() =
default
;
28
~FormattedLog
();
29
30
FormattedLog
(
FormattedLog
&&) =
delete
;
// no need to support copying of any kind
31
33
bool
usesDaemon
()
const
;
34
37
void
parseOptions
(
ConfigParser
&,
const
char
*defaultFormat);
38
40
void
dumpOptions
(std::ostream &os)
const
;
41
43
void
setLogformat
(
const
char
*logformatName);
44
46
void
open
();
47
49
void
rotate
();
50
52
void
close
();
53
55
Logfile
*
logfile
=
nullptr
;
56
58
char
*
filename
=
nullptr
;
59
61
ACLList
*
aclList
=
nullptr
;
62
64
Format::Format
*
logFormat
=
nullptr
;
65
67
Log::Format::log_type
type
=
Log::Format::CLF_UNKNOWN
;
68
70
size_t
bufferSize
= 8*
MAX_URL
;
71
73
std::optional<unsigned int>
rotationsToKeep
;
74
76
bool
fatal
=
true
;
77
};
78
79
#endif
/* SQUID_SRC_LOG_FORMATTEDLOG_H */
80
Formats.h
forward.h
ConfigParser
Definition
ConfigParser.h:46
Format::Format
Definition
Format.h:42
FormattedLog
Definition
FormattedLog.h:25
FormattedLog::type
Log::Format::log_type type
log record template ID
Definition
FormattedLog.h:67
FormattedLog::filename
char * filename
logging destination
Definition
FormattedLog.h:58
FormattedLog::close
void close()
stop recording entries
Definition
FormattedLog.cc:166
FormattedLog::dumpOptions
void dumpOptions(std::ostream &os) const
reports explicitly-configured key=value options, in squid.conf format
Definition
FormattedLog.cc:83
FormattedLog::setLogformat
void setLogformat(const char *logformatName)
configures formatting-related settings for the given logformat name
Definition
FormattedLog.cc:127
FormattedLog::fatal
bool fatal
whether unrecoverable errors (e.g., dropping a log record) kill worker
Definition
FormattedLog.h:76
FormattedLog::open
void open()
prepare for recording entries
Definition
FormattedLog.cc:150
FormattedLog::usesDaemon
bool usesDaemon() const
Definition
FormattedLog.cc:30
FormattedLog::FormattedLog
FormattedLog()=default
FormattedLog::logFormat
Format::Format * logFormat
custom log record template for type == Log::Format::CLF_CUSTOM
Definition
FormattedLog.h:64
FormattedLog::bufferSize
size_t bufferSize
how much to buffer before dropping or dying (buffer-size=N)
Definition
FormattedLog.h:70
FormattedLog::rotate
void rotate()
handle the log rotation request
Definition
FormattedLog.cc:159
FormattedLog::logfile
Logfile * logfile
records writer
Definition
FormattedLog.h:55
FormattedLog::rotationsToKeep
std::optional< unsigned int > rotationsToKeep
how many log files to retain when rotating. Default: obey logfile_rotate
Definition
FormattedLog.h:73
FormattedLog::FormattedLog
FormattedLog(FormattedLog &&)=delete
FormattedLog::~FormattedLog
~FormattedLog()
Definition
FormattedLog.cc:21
FormattedLog::parseOptions
void parseOptions(ConfigParser &, const char *defaultFormat)
Definition
FormattedLog.cc:36
FormattedLog::aclList
ACLList * aclList
restrict logging to matching transactions
Definition
FormattedLog.h:61
Logfile
Definition
File.h:39
RefCount< Acl::Tree >
MAX_URL
#define MAX_URL
Definition
defines.h:76
forward.h
Log::Format::log_type
log_type
Definition
Formats.h:26
Log::Format::CLF_UNKNOWN
@ CLF_UNKNOWN
Definition
Formats.h:27
squid
src
log
FormattedLog.h
Generated by
1.9.8