blob: 9b700b0e084eec8782395d8466554ce3f23b7c18 [file] [log] [blame]
Willy Tarreaubaaee002006-06-26 02:48:02 +02001/*
2 include/types/log.h
3 This file contains definitions of log-related structures and macros.
4
5 Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation, version 2.1
10 exclusively.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20*/
21
22#ifndef _TYPES_LOG_H
23#define _TYPES_LOG_H
24
Willy Tarreau019767b2007-12-05 11:11:55 +010025#include <sys/socket.h>
Robert Tsai81ae1952007-12-05 10:47:29 +010026#include <sys/un.h>
27#include <netinet/in.h>
Willy Tarreaue3ba5f02006-06-29 18:54:54 +020028#include <common/config.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020029
30#define MAX_SYSLOG_LEN 1024
31#define NB_LOG_FACILITIES 24
32#define NB_LOG_LEVELS 8
33#define SYSLOG_PORT 514
34
35
36/* fields that need to be logged. They appear as flags in session->logs.logwait */
37#define LW_DATE 1 /* date */
38#define LW_CLIP 2 /* CLient IP */
39#define LW_SVIP 4 /* SerVer IP */
40#define LW_SVID 8 /* server ID */
41#define LW_REQ 16 /* http REQuest */
42#define LW_RESP 32 /* http RESPonse */
43#define LW_PXIP 64 /* proxy IP */
44#define LW_PXID 128 /* proxy ID */
45#define LW_BYTES 256 /* bytes read from server */
46#define LW_COOKIE 512 /* captured cookie */
47#define LW_REQHDR 1024 /* request header(s) */
48#define LW_RSPHDR 2048 /* response header(s) */
49
Robert Tsai81ae1952007-12-05 10:47:29 +010050struct logsrv {
William Lallemand0f99e342011-10-12 17:50:54 +020051 struct list list;
David du Colombier11bcb6c2011-03-24 12:23:00 +010052 struct sockaddr_storage addr;
William Lallemand0f99e342011-10-12 17:50:54 +020053 int facility;
54 int level;
55 int minlvl;
Robert Tsai81ae1952007-12-05 10:47:29 +010056};
57
Willy Tarreaubaaee002006-06-26 02:48:02 +020058#endif /* _TYPES_LOG_H */
59
60/*
61 * Local variables:
62 * c-indent-level: 8
63 * c-basic-offset: 8
64 * End:
65 */