From 0e8d1736e517191c017f565e66fab8aa88a5bf42 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Mon, 19 Aug 2013 14:25:56 +0100 Subject: [PATCH] Disable database logging by default. It can be re-enabled using --enable-dblog Until we actually start using this data somewhere there is not much point in storing it. Since it's already known that writing to the database can affect I/O performance, especially where drives are shared with recordings, this could potentially even cause a positive feedback loop. The I/O starvation causes the backend to start logging slow read/write warnings, which in turn increase the writes to the database exacerbating the problems. The same problem is also true, to a greater or lesser extent with file based logging but we actually need the file logs so there isn't much we can do there. --- mythtv/libs/libmythbase/logging.cpp | 4 ++-- mythtv/libs/libmythbase/mythcommandlineparser.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mythtv/libs/libmythbase/logging.cpp b/mythtv/libs/libmythbase/logging.cpp index a0eb05fb206..51efcddd8a5 100644 --- a/mythtv/libs/libmythbase/logging.cpp +++ b/mythtv/libs/libmythbase/logging.cpp @@ -802,8 +802,8 @@ void logPropagateCalc(void) if (!logPropagateOpts.dblog) { - logPropagateArgs += " --nodblog"; - logPropagateArgList << "--nodblog"; + logPropagateArgs += " --enable-dblog"; + logPropagateArgList << "--enable-dblog"; } #ifndef _WIN32 diff --git a/mythtv/libs/libmythbase/mythcommandlineparser.cpp b/mythtv/libs/libmythbase/mythcommandlineparser.cpp index 1497ef5ca63..a328df50d76 100644 --- a/mythtv/libs/libmythbase/mythcommandlineparser.cpp +++ b/mythtv/libs/libmythbase/mythcommandlineparser.cpp @@ -2376,7 +2376,7 @@ void MythCommandLineParser::addUPnP(void) /** \brief Canned argument definition for all logging options, including * --verbose, --logpath, --quiet, --loglevel, --syslog - * and --nodblog + * and --enable-dblog */ void MythCommandLineParser::addLogging( const QString &defaultVerbosity, LogLevel_t defaultLogLevel) @@ -2418,7 +2418,7 @@ void MythCommandLineParser::addLogging( "Set the syslog logging facility.\nSet to \"none\" to disable, " "defaults to none.", "") ->SetGroup("Logging"); - add("--nodblog", "nodblog", false, "Disable database logging.", "") + add("--enable-dblog", "enabledblog", false, "Enable logging to database.", "") ->SetGroup("Logging"); add(QStringList( QStringList() << "-l" << "--logfile" ), @@ -2577,7 +2577,7 @@ int MythCommandLineParser::ConfigureLogging(QString mask, unsigned int progress) } int facility = GetSyslogFacility(); - bool dblog = !toBool("nodblog"); + bool dblog = toBool("enabledblog"); LogLevel_t level = GetLogLevel(); if (level == LOG_UNKNOWN) return GENERIC_EXIT_INVALID_CMDLINE;