summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.php.sample3
-rw-r--r--index.php6
-rw-r--r--lib/common.php1
3 files changed, 9 insertions, 1 deletions
diff --git a/config.php.sample b/config.php.sample
index 6e55eaffc..a6cada77a 100644
--- a/config.php.sample
+++ b/config.php.sample
@@ -34,6 +34,9 @@ $config['site']['path'] = 'laconica';
# If you want logging sent to a file instead of syslog
#$config['site']['logfile'] = '/tmp/laconica.log';
+# Enables extra log information, for example full details of PEAR DB errors
+#$config['site']['logdebug'] = true;
+
# This is a PEAR DB DSN, see http://pear.php.net/manual/en/package.database.db.intro-dsn.php
# Set it to match your actual database
diff --git a/index.php b/index.php
index 914ba5bde..03c044415 100644
--- a/index.php
+++ b/index.php
@@ -43,7 +43,11 @@ function handleError($error)
return;
}
- common_log(LOG_ERR, "PEAR error: " . $error->getMessage());
+ $logmsg = "PEAR error: " . $error->getMessage();
+ if(common_config('site', 'logdebug')) {
+ $logmsg .= " : ". $error->getDebugInfo();
+ }
+ common_log(LOG_ERR, $logmsg);
$msg = sprintf(_('The database for %s isn\'t responding correctly, '.
'so the site won\'t work properly. '.
'The site admins probably know about the problem, '.
diff --git a/lib/common.php b/lib/common.php
index 0fff3af2e..3df68d98a 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -73,6 +73,7 @@ $config =
'theme' => 'default',
'path' => $_path,
'logfile' => null,
+ 'logdebug' => false,
'fancy' => false,
'locale_path' => INSTALLDIR.'/locale',
'language' => 'en_US',