]>
Commit | Line | Data |
---|---|---|
f7f3304a | 1 | #include "squid-old.h" |
3ff65596 AR |
2 | #include "icap_log.h" |
3 | #include "AccessLogEntry.h" | |
82b7abe3 | 4 | #include "log/File.h" |
20efa1c2 | 5 | #include "log/Formats.h" |
3ff65596 AR |
6 | |
7 | int IcapLogfileStatus = LOG_DISABLE; | |
8 | ||
9 | void | |
10 | icapLogOpen() | |
11 | { | |
12 | customlog *log; | |
13 | ||
14 | for (log = Config.Log.icaplogs; log; log = log->next) { | |
20efa1c2 | 15 | if (log->type == Log::Format::CLF_NONE) |
3ff65596 AR |
16 | continue; |
17 | ||
3ff65596 AR |
18 | log->logfile = logfileOpen(log->filename, MAX_URL << 1, 1); |
19 | ||
20 | IcapLogfileStatus = LOG_ENABLE; | |
21 | } | |
22 | } | |
23 | ||
e1381638 | 24 | void |
3ff65596 AR |
25 | icapLogClose() |
26 | { | |
27 | customlog *log; | |
28 | ||
29 | for (log = Config.Log.icaplogs; log; log = log->next) { | |
30 | if (log->logfile) { | |
31 | logfileClose(log->logfile); | |
32 | log->logfile = NULL; | |
33 | } | |
34 | } | |
35 | } | |
36 | ||
37 | void | |
38 | icapLogRotate() | |
39 | { | |
40 | for (customlog* log = Config.Log.icaplogs; log; log = log->next) { | |
41 | if (log->logfile) { | |
42 | logfileRotate(log->logfile); | |
43 | } | |
44 | } | |
45 | } | |
46 | ||
47 | void icapLogLog(AccessLogEntry *al, ACLChecklist * checklist) | |
48 | { | |
49 | if (IcapLogfileStatus == LOG_ENABLE) | |
50 | accessLogLogTo(Config.Log.icaplogs, al, checklist); | |
51 | } |