From: Fabian Keil Date: Sun, 14 Dec 2008 15:46:23 +0000 (+0000) Subject: Give crunched requests their own log level. X-Git-Tag: v_3_0_11~133 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=df2406dbb38aaf0210665014dde3b1cfc429d687 Give crunched requests their own log level. --- diff --git a/config b/config index ffa50bd0..5f71d4af 100644 --- a/config +++ b/config @@ -1,6 +1,6 @@ # Sample Configuration File for Privoxy v3.0.11 # -# $Id: config,v 1.67 2008/08/30 15:31:53 fabiankeil Exp $ +# $Id: config,v 1.68 2008/12/13 18:19:44 fabiankeil Exp $ # # Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/ # @@ -557,7 +557,7 @@ logfile logfile # # The available debug levels are: # -# debug 1 # log each request destination (and the crunch reason if Privoxy intercepted the request) +# debug 1 # Log the destination for each request Privoxy let through. See also debug 1024. # debug 2 # show each connection status # debug 4 # show I/O status # debug 8 # show header parsing @@ -567,7 +567,7 @@ logfile logfile # debug 128 # debug redirects # debug 256 # debug GIF de-animation # debug 512 # Common Log Format -# debug 1024 # Unused +# debug 1024 # Log the destination for requests Privoxy didn't let through, and the reason why. # debug 2048 # CGI user interface # debug 4096 # Startup banner and warnings. # debug 8192 # Non-fatal errors @@ -601,7 +601,8 @@ logfile logfile # you read the log messages, you may even be able to solve the # problem on your own. # -#debug 1 # log each request destination (and the crunch reason if Privoxy intercepted the request) +#debug 1 # Log the destination for each request Privoxy let through. +#debug 1024 # Log the destination for requests Privoxy didn't let through, and the reason why. #debug 4096 # Startup banner and warnings #debug 8192 # Non-fatal errors # diff --git a/doc/source/p-config.sgml b/doc/source/p-config.sgml index b1079f95..c62e0341 100644 --- a/doc/source/p-config.sgml +++ b/doc/source/p-config.sgml @@ -3,7 +3,7 @@ Purpose : Used with other docs and files only. - $Id: p-config.sgml,v 2.32 2008/08/30 12:03:09 fabiankeil Exp $ + $Id: p-config.sgml,v 2.33 2008/12/13 10:48:21 fabiankeil Exp $ Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/ See LICENSE. @@ -95,7 +95,7 @@ Sample Configuration File for Privoxy v&p-version; - $Id: p-config.sgml,v 2.32 2008/08/30 12:03:09 fabiankeil Exp $ + $Id: p-config.sgml,v 2.33 2008/12/13 10:48:21 fabiankeil Exp $ Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/ @@ -1004,7 +1004,7 @@ actionsfile - debug 1 # log each request destination (and the crunch reason if &my-app; intercepted the request) + debug 1 # Log the destination for each request &my-app; let through. See also debug 1024. debug 2 # show each connection status debug 4 # show I/O status debug 8 # show header parsing @@ -1014,6 +1014,7 @@ actionsfile debug 128 # debug redirects debug 256 # debug GIF de-animation debug 512 # Common Log Format + debug 1024 # Log the destination for requests &my-app; didn't let through, and the reason why. debug 2048 # CGI user interface debug 4096 # Startup banner and warnings. debug 8192 # Non-fatal errors @@ -1058,7 +1059,8 @@ actionsfile -@@#debug 1 # log each request destination (and the crunch reason if &my-app; intercepted the request)]]> +@@#debug 1 # Log the destination for each request &my-app; let through.]]> +@@#debug 1024 # Log the destination for requests &my-app; didn't let through, and the reason why.]]> @@#debug 4096 # Startup banner and warnings]]> @@#debug 8192 # Non-fatal errors]]> diff --git a/errlog.c b/errlog.c index c69b8d71..22f5ae4a 100644 --- a/errlog.c +++ b/errlog.c @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.82 2008/11/23 16:06:58 fabiankeil Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.83 2008/12/04 18:14:32 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ @@ -33,6 +33,9 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.82 2008/11/23 16:06:58 fabiankeil E * * Revisions : * $Log: errlog.c,v $ + * Revision 1.83 2008/12/04 18:14:32 fabiankeil + * Fix some cparser warnings. + * * Revision 1.82 2008/11/23 16:06:58 fabiankeil * Update a log message I missed in 1.80. * @@ -952,6 +955,9 @@ static inline const char *get_log_level_string(int loglevel) case LOG_LEVEL_DEANIMATE: log_level_string = "Gif-Deanimate"; break; + case LOG_LEVEL_CRUNCH: + log_level_string = "Crunch"; + break; case LOG_LEVEL_CGI: log_level_string = "CGI"; break; @@ -1002,7 +1008,7 @@ void log_error(int loglevel, const char *fmt, ...) * the taskbar icon animate. (There is an option to disable * this but checking that is handled inside LogShowActivity()). */ - if (loglevel == LOG_LEVEL_GPC) + if ((loglevel == LOG_LEVEL_GPC) || (loglevel == LOG_LEVEL_CRUNCH)) { LogShowActivity(); } diff --git a/errlog.h b/errlog.h index ee08d53e..950f52d2 100644 --- a/errlog.h +++ b/errlog.h @@ -1,6 +1,6 @@ #ifndef ERRLOG_H_INCLUDED #define ERRLOG_H_INCLUDED -#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.19 2007/10/14 14:12:41 fabiankeil Exp $" +#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.20 2008/03/27 18:27:23 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.h,v $ @@ -35,6 +35,9 @@ * * Revisions : * $Log: errlog.h,v $ + * Revision 1.20 2008/03/27 18:27:23 fabiankeil + * Remove kill-popups action. + * * Revision 1.19 2007/10/14 14:12:41 fabiankeil * When in daemon mode, close stderr after the configuration file has been * parsed the first time. If logfile isn't set, stop logging. Fixes BR#897436. @@ -157,6 +160,7 @@ extern "C" { /* Debug level for errors */ +/* XXX: Should be renamed. */ #define LOG_LEVEL_GPC 0x0001 #define LOG_LEVEL_CONNECT 0x0002 #define LOG_LEVEL_IO 0x0004 @@ -169,6 +173,7 @@ extern "C" { #define LOG_LEVEL_REDIRECTS 0x0080 #define LOG_LEVEL_DEANIMATE 0x0100 #define LOG_LEVEL_CLF 0x0200 /* Common Log File format */ +#define LOG_LEVEL_CRUNCH 0x0400 #define LOG_LEVEL_CGI 0x0800 /* CGI / templates */ /* Following are always on: */ diff --git a/jcc.c b/jcc.c index d6bbf854..2423c285 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.210 2008/12/02 22:03:18 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.211 2008/12/06 10:05:03 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -33,6 +33,10 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.210 2008/12/02 22:03:18 fabiankeil Exp $" * * Revisions : * $Log: jcc.c,v $ + * Revision 1.211 2008/12/06 10:05:03 fabiankeil + * Downgrade "Received x bytes while expecting y." message to + * LOG_LEVEL_CONNECT as it doesn't necessarily indicate an error. + * * Revision 1.210 2008/12/02 22:03:18 fabiankeil * Don't miscalculate byte_count if we don't get all the * server headers with one read_socket() call. With keep-alive @@ -1817,8 +1821,8 @@ static void send_crunch_response(const struct client_state *csp, struct http_res } /* Log that the request was crunched and why. */ - log_error(LOG_LEVEL_GPC, "%s%s crunch! (%s)", - http->hostport, http->path, crunch_reason(rsp)); + log_error(LOG_LEVEL_CRUNCH, "%s: %s%s", + crunch_reason(rsp), http->hostport, http->path); log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" %s %d", csp->ip_addr_str, http->ocmd, status_code, rsp->content_length);