diff options
author | Edward Rudd | 2008-10-30 23:10:36 +0000 |
---|---|---|
committer | Edward Rudd | 2008-10-30 23:10:36 +0000 |
commit | eb35c38579da75061822524c7a7eafc72b2d0e7e (patch) | |
tree | 49b8ec4ceef5ca84c698fa535750b546bdfd5990 | |
parent | e940dd14426c5a725fda70a154fd2bf4bb91ba44 (diff) |
make sure marker lines is written on filechange for badlines log
-rw-r--r-- | utility/config.h | 1 | ||||
-rw-r--r-- | utility/logparse.c | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/utility/config.h b/utility/config.h index c627662..ebedec3 100644 --- a/utility/config.h +++ b/utility/config.h | |||
@@ -30,6 +30,7 @@ struct config_t { | |||
30 | apr_pool_t *errorlog_p; | 30 | apr_pool_t *errorlog_p; |
31 | 31 | ||
32 | const char *badlinefile; | 32 | const char *badlinefile; |
33 | const char *badlastfile; | ||
33 | apr_file_t *badline_fp; | 34 | apr_file_t *badline_fp; |
34 | int badline_count; | 35 | int badline_count; |
35 | int badlinemax; | 36 | int badlinemax; |
diff --git a/utility/logparse.c b/utility/logparse.c index ec587a8..d172f27 100644 --- a/utility/logparse.c +++ b/utility/logparse.c | |||
@@ -228,7 +228,10 @@ apr_status_t parser_logbadline(config_t *cfg, const char *filename, | |||
228 | logging_log(cfg, LOGLEVEL_NOISE, | 228 | logging_log(cfg, LOGLEVEL_NOISE, |
229 | "Error opening badline file %s\n", cfg->badlinefile); | 229 | "Error opening badline file %s\n", cfg->badlinefile); |
230 | cfg->badlinefile = NULL; | 230 | cfg->badlinefile = NULL; |
231 | } else { | 231 | } |
232 | } | ||
233 | if (!rv) { | ||
234 | if (filename != cfg->badlastfile){ | ||
232 | char date[APR_RFC822_DATE_LEN]; | 235 | char date[APR_RFC822_DATE_LEN]; |
233 | vec[0].iov_base = "Starting BadLines for \""; | 236 | vec[0].iov_base = "Starting BadLines for \""; |
234 | vec[0].iov_len = sizeof("Starting BadLines for \"")-1; | 237 | vec[0].iov_len = sizeof("Starting BadLines for \"")-1; |
@@ -242,9 +245,9 @@ apr_status_t parser_logbadline(config_t *cfg, const char *filename, | |||
242 | vec[4].iov_base = "\n"; | 245 | vec[4].iov_base = "\n"; |
243 | vec[4].iov_len = 1; | 246 | vec[4].iov_len = 1; |
244 | apr_file_writev(cfg->badline_fp, vec,5, &len); | 247 | apr_file_writev(cfg->badline_fp, vec,5, &len); |
248 | cfg->badlastfile = filename; | ||
245 | } | 249 | } |
246 | } | 250 | |
247 | if (!rv) { | ||
248 | if ((++cfg->badline_count) > cfg->badlinemax) { | 251 | if ((++cfg->badline_count) > cfg->badlinemax) { |
249 | logging_log(cfg, LOGLEVEL_NOISE, | 252 | logging_log(cfg, LOGLEVEL_NOISE, |
250 | "Found more than %d bad lines (found %d)", | 253 | "Found more than %d bad lines (found %d)", |