icap_log.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 
21 
22 void
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 
34  }
35 }
36 
37 void
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 = NULL;
46  }
47  }
48 }
49 
50 void
52 {
53  for (CustomLog* log = Config.Log.icaplogs; log; log = log->next) {
54  if (log->logfile) {
56  }
57  }
58 }
59 
61 {
63  ACLFilledChecklist checklist(NULL, al->adapted_request, NULL);
64  if (al->reply) {
65  checklist.reply = al->reply;
66  HTTPMSGLOCK(checklist.reply);
67  }
68  accessLogLogTo(Config.Log.icaplogs, al, &checklist);
69  }
70 }
71 
representation of a custom log directive.
Definition: CustomLog.h:22
void icapLogLog(AccessLogEntry::Pointer &al)
Definition: icap_log.cc:60
void log(char *format,...)
int IcapLogfileStatus
Definition: icap_log.cc:20
void HTTPMSGLOCK(Http::Message *a)
Definition: Message.h:154
Log::Format::log_type type
Definition: CustomLog.h:30
Logfile * logfileOpen(const char *path, size_t bufsz, int fatal_flag)
Definition: File.cc:38
Logfile * logfile
Definition: CustomLog.h:28
size_t bufferSize
how much to buffer before dropping or dying (access_log buffer-size)
Definition: CustomLog.h:32
CustomLog * icaplogs
Definition: SquidConfig.h:178
struct SquidConfig::@103 Log
CustomLog * next
Definition: CustomLog.h:29
void logfileClose(Logfile *lf)
Definition: File.cc:90
void icapLogOpen()
Definition: icap_log.cc:23
char * filename
Definition: CustomLog.h:25
void accessLogLogTo(CustomLog *log, AccessLogEntry::Pointer &al, ACLChecklist *checklist=NULL)
Definition: access_log.cc:74
#define LOG_DISABLE
Definition: defines.h:100
#define LOG_ENABLE
Definition: defines.h:99
void logfileRotate(Logfile *lf, int16_t rotateCount)
Definition: File.cc:99
int rotateNumber
Definition: SquidConfig.h:180
void icapLogRotate()
Definition: icap_log.cc:51
void icapLogClose()
Definition: icap_log.cc:38
bool fatal
whether unrecoverable errors (e.g., dropping a log record) kill worker
Definition: CustomLog.h:34
class SquidConfig Config
Definition: SquidConfig.cc:12
#define NULL
Definition: types.h:166

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors