Squid Web Cache
master
Loading...
Searching...
No Matches
icap_log.cc
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
#include "
squid.h
"
10
#include "
AccessLogEntry.h
"
11
#include "
acl/FilledChecklist.h
"
12
#include "
globals.h
"
13
#include "
HttpReply.h
"
14
#include "
icap_log.h
"
15
#include "
log/CustomLog.h
"
16
#include "
log/File.h
"
17
#include "
log/Formats.h
"
18
#include "
SquidConfig.h
"
19
20
int
IcapLogfileStatus
=
LOG_DISABLE
;
21
22
void
23
icapLogOpen
()
24
{
25
CustomLog
*
log
;
26
27
for
(
log
=
Config
.
Log
.
icaplogs
;
log
;
log
=
log
->next) {
28
if
(
log
->type ==
Log::Format::CLF_NONE
)
29
continue
;
30
31
log
->
logfile
=
logfileOpen
(
log
->filename,
log
->bufferSize,
log
->fatal);
32
33
IcapLogfileStatus
=
LOG_ENABLE
;
34
}
35
}
36
37
void
38
icapLogClose
()
39
{
40
CustomLog
*
log
;
41
42
for
(
log
=
Config
.
Log
.
icaplogs
;
log
;
log
=
log
->next) {
43
if
(
log
->logfile) {
44
logfileClose
(
log
->logfile);
45
log
->logfile =
nullptr
;
46
}
47
}
48
}
49
50
void
51
icapLogRotate
()
52
{
53
for
(
CustomLog
*
log
=
Config
.
Log
.
icaplogs
;
log
;
log
=
log
->next) {
54
if
(
log
->logfile) {
55
logfileRotate
(
log
->logfile,
Config
.
Log
.
rotateNumber
);
56
}
57
}
58
}
59
60
void
icapLogLog
(
AccessLogEntry::Pointer
&al)
61
{
62
if
(
IcapLogfileStatus
==
LOG_ENABLE
) {
63
ACLFilledChecklist
checklist(
nullptr
, al->
adapted_request
);
64
checklist.
updateAle
(al);
65
accessLogLogTo
(
Config
.
Log
.
icaplogs
, al, &checklist);
66
}
67
}
68
AccessLogEntry.h
accessLogLogTo
void accessLogLogTo(CustomLog *, const AccessLogEntryPointer &, ACLChecklist *checklist=nullptr)
Definition
access_log.cc:66
CustomLog.h
FilledChecklist.h
Formats.h
HttpReply.h
Config
class SquidConfig Config
Definition
SquidConfig.cc:12
SquidConfig.h
log
void log(char *format,...)
ACLFilledChecklist
Definition
FilledChecklist.h:34
ACLFilledChecklist::updateAle
void updateAle(const AccessLogEntry::Pointer &)
Definition
FilledChecklist.cc:209
AccessLogEntry::adapted_request
HttpRequest * adapted_request
Definition
AccessLogEntry.h:193
CustomLog
Definition
CustomLog.h:18
FormattedLog::logfile
Logfile * logfile
records writer
Definition
FormattedLog.h:55
RefCount< AccessLogEntry >
SquidConfig::Log
struct SquidConfig::@82 Log
SquidConfig::icaplogs
CustomLog * icaplogs
Definition
SquidConfig.h:188
SquidConfig::rotateNumber
int rotateNumber
Definition
SquidConfig.h:191
LOG_DISABLE
#define LOG_DISABLE
Definition
defines.h:61
LOG_ENABLE
#define LOG_ENABLE
Definition
defines.h:60
globals.h
icapLogLog
void icapLogLog(AccessLogEntry::Pointer &al)
Definition
icap_log.cc:60
IcapLogfileStatus
int IcapLogfileStatus
Definition
icap_log.cc:20
icapLogClose
void icapLogClose()
Definition
icap_log.cc:38
icapLogRotate
void icapLogRotate()
Definition
icap_log.cc:51
icapLogOpen
void icapLogOpen()
Definition
icap_log.cc:23
icap_log.h
logfileRotate
void logfileRotate(Logfile *lf, int16_t rotateCount)
Definition
File.cc:101
logfileClose
void logfileClose(Logfile *lf)
Definition
File.cc:92
logfileOpen
Logfile * logfileOpen(const char *path, size_t bufsz, int fatal_flag)
Definition
File.cc:40
File.h
Log::Format::CLF_NONE
@ CLF_NONE
Definition
Formats.h:37
squid.h
squid
src
adaptation
icap
icap_log.cc
Generated by
1.9.8