]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/icap/icap_log.cc
SourceFormat: enforcement
[thirdparty/squid.git] / src / adaptation / icap / icap_log.cc
1 #include "squid.h"
2 #include "icap_log.h"
3 #include "AccessLogEntry.h"
4
5 int IcapLogfileStatus = LOG_DISABLE;
6
7 void
8 icapLogOpen()
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
25 void
26 icapLogClose()
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
38 void
39 icapLogRotate()
40 {
41 for (customlog* log = Config.Log.icaplogs; log; log = log->next) {
42 if (log->logfile) {
43 logfileRotate(log->logfile);
44 }
45 }
46 }
47
48 void icapLogLog(AccessLogEntry *al, ACLChecklist * checklist)
49 {
50 if (IcapLogfileStatus == LOG_ENABLE)
51 accessLogLogTo(Config.Log.icaplogs, al, checklist);
52 }