diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-10-15 18:38:49 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-10-15 18:56:22 +0300 |
commit | ef3f928cc712f6774e19f8cb8f880cbeac15e8ff (patch) | |
tree | 88f59a4c8d1867bfadb924ee547b4b74a97c5ce0 /src/vmod-binlog.h | |
parent | f035194d7d1b6cc0846ad7a5d86e0d6fa9463c67 (diff) | |
download | vmod-binlog-ef3f928cc712f6774e19f8cb8f880cbeac15e8ff.tar.gz vmod-binlog-ef3f928cc712f6774e19f8cb8f880cbeac15e8ff.tar.bz2 |
Change default log naming.
* configure.ac: Call AM_PROG_CC_C_O
* src/binlog.c (BLF_TRUNCATE): New flag.
(vmod_init): Change pattern initialization.
New parameter "reuselog".
(createfile): Remove O_TRUNC.
(checkheader): New function.
(newfile): Reuse existing file, if it is the first file
to be opened after varnish startup and its header matches
exactly our data.
* src/binlogsel.c: Use indexed directory structure to speed up
searches.
* src/vmod-binlog.h (BINLOG_PATTERN): Change pattern.
(BINLOG_GLOB_PATTERN,BINLOG_INDEX): New defines.
Diffstat (limited to 'src/vmod-binlog.h')
-rw-r--r-- | src/vmod-binlog.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/vmod-binlog.h b/src/vmod-binlog.h index 06d517d..e39ccea 100644 --- a/src/vmod-binlog.h +++ b/src/vmod-binlog.h @@ -24,7 +24,15 @@ #endif #ifndef BINLOG_PATTERN -# define BINLOG_PATTERN "%Y/%m/%d.log" +# define BINLOG_PATTERN "%Y%m%dT%H%M%S.log" +#endif + +#ifndef BINLOG_GLOB_PATTERN +# define BINLOG_GLOB_PATTERN "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]T[0-9][0-9][0-9][0-9][0-9][0-9].log" +#endif + +#ifndef BINLOG_INDEX +# define BINLOG_INDEX "year" #endif #ifndef BINLOG_INTERVAL @@ -35,6 +43,14 @@ # define BINLOG_UMASK 0077 #endif +enum binlog_index_type { + index_year, + index_month, + index_day, + +}; +#define index_last index_day + struct binlog_record { time_t ts; /* timestamp */ char data[1]; /* payload */ |