]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/icap/icap_log.cc
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
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.
10 #include "AccessLogEntry.h"
11 #include "acl/FilledChecklist.h"
13 #include "HttpReply.h"
15 #include "log/CustomLog.h"
17 #include "log/Formats.h"
18 #include "SquidConfig.h"
20 int IcapLogfileStatus
= LOG_DISABLE
;
27 for (log
= Config
.Log
.icaplogs
; log
; log
= log
->next
) {
28 if (log
->type
== Log::Format::CLF_NONE
)
31 log
->logfile
= logfileOpen(log
->filename
, log
->bufferSize
, log
->fatal
);
33 IcapLogfileStatus
= LOG_ENABLE
;
42 for (log
= Config
.Log
.icaplogs
; log
; log
= log
->next
) {
44 logfileClose(log
->logfile
);
53 for (CustomLog
* log
= Config
.Log
.icaplogs
; log
; log
= log
->next
) {
55 logfileRotate(log
->logfile
);
60 void icapLogLog(AccessLogEntry::Pointer
&al
)
62 if (IcapLogfileStatus
== LOG_ENABLE
) {
63 ACLFilledChecklist
checklist(NULL
, al
->adapted_request
, NULL
);
65 checklist
.reply
= al
->reply
;
66 HTTPMSGLOCK(checklist
.reply
);
68 accessLogLogTo(Config
.Log
.icaplogs
, al
, &checklist
);