]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Additional (optional, defaults to off) logging of PEAR error details, which allows...
authorCiaranG <ciaran@ciarang.com>
Wed, 4 Mar 2009 00:23:34 +0000 (00:23 +0000)
committerCiaranG <ciaran@ciarang.com>
Wed, 4 Mar 2009 00:23:34 +0000 (00:23 +0000)
config.php.sample
index.php
lib/common.php

index 6e55eaffc8bdf9190fafd0e735008ed787360af1..a6cada77a27bcf9b2a46f0126f123a1dce6fa733 100644 (file)
@@ -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
 
index 914ba5bde1453e2c21122a0766e8fc95fd8ac6cb..03c044415dc2f31e6178afded3236ec92efbad18 100644 (file)
--- 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, '.
index 0fff3af2ea8b23704f97bd693a104b7482f71567..3df68d98a2140cf6e43ac85c1bc787a6c0b3d625 100644 (file)
@@ -73,6 +73,7 @@ $config =
               'theme' => 'default',
               'path' => $_path,
               'logfile' => null,
+              'logdebug' => false,
               'fancy' => false,
               'locale_path' => INSTALLDIR.'/locale',
               'language' => 'en_US',