]> git.ipfire.org Git - thirdparty/squid.git/blame - src/adaptation/icap/icap_log.cc
SourceFormat: enforcement
[thirdparty/squid.git] / src / adaptation / icap / icap_log.cc
CommitLineData
3ff65596
AR
1#include "squid.h"
2#include "icap_log.h"
3#include "AccessLogEntry.h"
4
5int IcapLogfileStatus = LOG_DISABLE;
6
7void
8icapLogOpen()
9{
10 customlog *log;
11
12 for (log = Config.Log.icaplogs; log; log = log->next) {
13 if (log->type == CLF_NONE)
14 continue;
15
16 if (log->type == CLF_AUTO)
17 log->type = CLF_ICAP_SQUID;
18
19 log->logfile = logfileOpen(log->filename, MAX_URL << 1, 1);
20
21 IcapLogfileStatus = LOG_ENABLE;
22 }
23}
24
e1381638 25void
3ff65596
AR
26icapLogClose()
27{
28 customlog *log;
29
30 for (log = Config.Log.icaplogs; log; log = log->next) {
31 if (log->logfile) {
32 logfileClose(log->logfile);
33 log->logfile = NULL;
34 }
35 }
36}
37
38void
39icapLogRotate()
40{
41 for (customlog* log = Config.Log.icaplogs; log; log = log->next) {
42 if (log->logfile) {
43 logfileRotate(log->logfile);
44 }
45 }
46}
47
48void icapLogLog(AccessLogEntry *al, ACLChecklist * checklist)
49{
50 if (IcapLogfileStatus == LOG_ENABLE)
51 accessLogLogTo(Config.Log.icaplogs, al, checklist);
52}