From c9dcc485c5e628bfa9ff2bbb878b29f3eda0b5d0 Mon Sep 17 00:00:00 2001
From: msweet
Date: Wed, 2 Apr 2014 16:52:53 +0000
Subject: [PATCH] CUPS: Disable gratuitous logging by
default
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11789 a1ca3aef-8c08-0410-bb20-df032aa958be
---
CHANGES.txt | 4 +++-
conf/cupsd.conf.in | 1 +
config-scripts/cups-defaults.m4 | 13 +++++++++++--
doc/help/ref-cupsd-conf.html.in | 3 +++
scheduler/conf.c | 2 ++
scheduler/conf.h | 1 +
scheduler/log.c | 4 +++-
7 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/CHANGES.txt b/CHANGES.txt
index 3e3853987..4fcb5903d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,4 @@
-CHANGES.txt - 2.0b1 - 2014-03-31
+CHANGES.txt - 2.0b1 - 2014-04-02
--------------------------------
CHANGES IN CUPS V2.0b1
@@ -13,6 +13,8 @@ CHANGES IN CUPS V2.0b1
scheduler (STR #4321)
- Adopted Linux man page conventions and updated all man pages
(STR #4372)
+ - Changed the default AccessLogLevel and PageLogFormat to disable the
+ access_log and page_log files by default ()
- Added a "--list-filters" option to the cupsfilter command (STR #4325)
- Added systemd support (STR #3917)
- Added support for re-sending a job as a raster file if a higher-level
diff --git a/conf/cupsd.conf.in b/conf/cupsd.conf.in
index 2c87fdf1a..e17601446 100644
--- a/conf/cupsd.conf.in
+++ b/conf/cupsd.conf.in
@@ -6,6 +6,7 @@
# Log general information in error_log - change "@CUPS_LOG_LEVEL@" to "debug"
# for troubleshooting...
LogLevel @CUPS_LOG_LEVEL@
+@CUPS_PAGE_LOG_FORMAT@
# Only listen for connections from the local machine.
Listen localhost:@DEFAULT_IPP_PORT@
diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4
index 02f9870a0..852aee96a 100644
--- a/config-scripts/cups-defaults.m4
+++ b/config-scripts/cups-defaults.m4
@@ -78,12 +78,21 @@ AC_SUBST(CUPS_LOG_LEVEL)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_LEVEL, "$CUPS_LOG_LEVEL")
dnl Default AccessLogLevel
-AC_ARG_WITH(access_log_level, [ --with-access-log-level set default AccessLogLevel value, default=actions],
+AC_ARG_WITH(access_log_level, [ --with-access-log-level set default AccessLogLevel value, default=none],
CUPS_ACCESS_LOG_LEVEL="$withval",
- CUPS_ACCESS_LOG_LEVEL="actions")
+ CUPS_ACCESS_LOG_LEVEL="none")
AC_SUBST(CUPS_ACCESS_LOG_LEVEL)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_ACCESS_LOG_LEVEL, "$CUPS_ACCESS_LOG_LEVEL")
+dnl Default PageLogFormat
+AC_ARG_WITH(page_logging, [ --enable-page-logging enable page_log by default])
+if test "x$enable_page_logging" = xyes; then
+ CUPS_PAGE_LOG_FORMAT=""
+else
+ CUPS_PAGE_LOG_FORMAT="PageLogFormat"
+fi
+AC_SUBST(CUPS_PAGE_LOG_FORMAT)
+
dnl Default Browsing
AC_ARG_ENABLE(browsing, [ --disable-browsing disable Browsing by default])
if test "x$enable_browsing" = xno; then
diff --git a/doc/help/ref-cupsd-conf.html.in b/doc/help/ref-cupsd-conf.html.in
index 904d01fdf..f77be82dd 100644
--- a/doc/help/ref-cupsd-conf.html.in
+++ b/doc/help/ref-cupsd-conf.html.in
@@ -52,6 +52,7 @@ automatically handles restarting the scheduler.
AccessLogLevel config
AccessLogLevel actions
AccessLogLevel all
+AccessLogLevel none
Description
@@ -71,6 +72,8 @@ to the access log file. The following levels are defined:
all
; Log all requests.
+ none
; Log no requests.
+
The default access log level is @CUPS_ACCESS_LOG_LEVEL@
.
diff --git a/scheduler/conf.c b/scheduler/conf.c
index 3c2143e67..5da2249c9 100644
--- a/scheduler/conf.c
+++ b/scheduler/conf.c
@@ -3135,6 +3135,8 @@ read_cupsd_conf(cups_file_t *fp) /* I - File to read from */
AccessLogLevel = CUPSD_ACCESSLOG_ACTIONS;
else if (!_cups_strcasecmp(value, "config"))
AccessLogLevel = CUPSD_ACCESSLOG_CONFIG;
+ else if (!_cups_strcasecmp(value, "none"))
+ AccessLogLevel = CUPSD_ACCESSLOG_NONE;
else
cupsdLogMessage(CUPSD_LOG_WARN, "Unknown AccessLogLevel %s on line %d.",
value, linenum);
diff --git a/scheduler/conf.h b/scheduler/conf.h
index 3cc8acb5e..dd69bdf73 100644
--- a/scheduler/conf.h
+++ b/scheduler/conf.h
@@ -39,6 +39,7 @@ typedef enum
typedef enum
{
+ CUPSD_ACCESSLOG_NONE, /* Log no requests */
CUPSD_ACCESSLOG_CONFIG, /* Log config requests */
CUPSD_ACCESSLOG_ACTIONS, /* Log config, print, and job management requests */
CUPSD_ACCESSLOG_ALL /* Log everything */
diff --git a/scheduler/log.c b/scheduler/log.c
index 527f4ccb0..d28fa0fdb 100644
--- a/scheduler/log.c
+++ b/scheduler/log.c
@@ -862,7 +862,9 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */
* Filter requests as needed...
*/
- if (AccessLogLevel < CUPSD_ACCESSLOG_ALL)
+ if (AccessLogLevel == CUPSD_ACCESSLOG_NONE)
+ return (1);
+ else if (AccessLogLevel < CUPSD_ACCESSLOG_ALL)
{
/*
* Eliminate simple GET, POST, and PUT requests...
--
2.39.2