Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 1 | /* |
| 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 Tarreau | 019767b | 2007-12-05 11:11:55 +0100 | [diff] [blame] | 25 | #include <sys/socket.h> |
Robert Tsai | 81ae195 | 2007-12-05 10:47:29 +0100 | [diff] [blame] | 26 | #include <sys/un.h> |
| 27 | #include <netinet/in.h> |
Willy Tarreau | e3ba5f0 | 2006-06-29 18:54:54 +0200 | [diff] [blame] | 28 | #include <common/config.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 29 | |
| 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 Tsai | 81ae195 | 2007-12-05 10:47:29 +0100 | [diff] [blame] | 50 | struct logsrv { |
| 51 | union { |
| 52 | struct sockaddr addr; |
| 53 | struct sockaddr_un un; /* AF_UNIX */ |
| 54 | struct sockaddr_in in; /* AF_INET */ |
| 55 | } u; |
| 56 | }; |
| 57 | |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 58 | #endif /* _TYPES_LOG_H */ |
| 59 | |
| 60 | /* |
| 61 | * Local variables: |
| 62 | * c-indent-level: 8 |
| 63 | * c-basic-offset: 8 |
| 64 | * End: |
| 65 | */ |