MEDIUM: log: New format-log flags: %Fi %Fp %Si %Sp %Ts %rt %H %pid
%Fi: Frontend IP
%Fp: Frontend Port
%Si: Server IP
%Sp: Server Port
%Ts: Timestamp
%rt: HTTP request counter
%H: hostname
%pid: PID
+X: Hexadecimal represenation
The +X mode in logformat displays hexadecimal for the following flags
%Ci %Cp %Fi %Fp %Bi %Bp %Si %Sp %Ts %ct %pid
rename logformat_write_string() to lf_text()
Optimize size computation
diff --git a/include/proto/log.h b/include/proto/log.h
index 2efb539..0e41eca 100644
--- a/include/proto/log.h
+++ b/include/proto/log.h
@@ -117,11 +117,24 @@
/*
* Write a string in the log string
- * Take cares of mandatory and quote options
+ * Take cares of quote options
*
* Return the adress of the \0 character, or NULL on error
*/
-char *logformat_write_string(char *dst, char *src, size_t size, struct logformat_node *node);
+char *lf_text(char *dst, char *src, size_t size, struct logformat_node *node);
+
+/*
+ * Write a IP adress to the log string
+ * +X option write in hexadecimal notation, most signifant byte on the left
+ */
+char *lf_ip(char *dst, struct sockaddr *sockaddr, size_t size, struct logformat_node *node);
+
+/*
+ * Write a port to the log
+ * +X option write in hexadecimal notation, most signifant byte on the left
+ */
+char *lf_port(char *dst, struct sockaddr *sockaddr, size_t size, struct logformat_node *node);
+
#endif /* _PROTO_LOG_H */
diff --git a/include/types/global.h b/include/types/global.h
index 9e63050..83caf21 100644
--- a/include/types/global.h
+++ b/include/types/global.h
@@ -73,6 +73,7 @@
int rlimit_nofile; /* default ulimit-n value : 0=unset */
int rlimit_memmax; /* default ulimit-d in megs value : 0=unset */
int mode;
+ unsigned int req_count; /* HTTP request counter */
int last_checks;
int spread_checks;
char *chroot;
diff --git a/include/types/log.h b/include/types/log.h
index efb1d91..ad96e9a 100644
--- a/include/types/log.h
+++ b/include/types/log.h
@@ -46,8 +46,15 @@
LOG_FMT_CLIENTPORT,
LOG_FMT_BACKENDIP,
LOG_FMT_BACKENDPORT,
+ LOG_FMT_FRONTENDIP,
+ LOG_FMT_FRONTENDPORT,
+ LOG_FMT_SERVERPORT,
+ LOG_FMT_SERVERIP,
+ LOG_FMT_COUNTER,
+ LOG_FMT_PID,
LOG_FMT_DATE,
LOG_FMT_DATEGMT,
+ LOG_FMT_TS,
LOG_FMT_MS,
LOG_FMT_FRONTEND,
LOG_FMT_BACKEND,
@@ -78,6 +85,7 @@
LOG_FMT_HDRREQUESTLIST,
LOG_FMT_HDRRESPONSLIST,
LOG_FMT_REQ,
+ LOG_FMT_HOSTNAME,
};
/* enum for parse_logformat */
@@ -99,7 +107,7 @@
char *arg;
};
-#define LOG_OPT_WRITTEN 0x00000001
+#define LOG_OPT_HEXA 0x00000001
#define LOG_OPT_MANDATORY 0x00000002
#define LOG_OPT_QUOTE 0x00000004