Skip to content

Commit

Permalink
Disable database logging by default.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stuartm committed Aug 19, 2013
1 parent 763c7ca commit 0e8d173
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmythbase/logging.cpp
Expand Up @@ -802,8 +802,8 @@ void logPropagateCalc(void)

if (!logPropagateOpts.dblog)
{
logPropagateArgs += " --nodblog";
logPropagateArgList << "--nodblog";
logPropagateArgs += " --enable-dblog";
logPropagateArgList << "--enable-dblog";
}

#ifndef _WIN32
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythbase/mythcommandlineparser.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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" ),
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0e8d173

Please sign in to comment.