Index: admin/settings/server.php =================================================================== RCS file: /cvsroot/moodle/moodle/admin/settings/server.php,v retrieving revision 1.41 diff -u -F ^f -r1.41 server.php --- admin/settings/server.php 6 May 2008 14:52:32 -0000 1.41 +++ admin/settings/server.php 2 Jul 2008 06:54:55 -0000 @@ -103,6 +103,7 @@ $temp = new admin_settingpage('debugging', get_string('debugging', 'admin')); $temp->add(new admin_setting_special_debug()); $temp->add(new admin_setting_configcheckbox('debugdisplay', get_string('debugdisplay', 'admin'), get_string('configdebugdisplay', 'admin'), ini_get('display_errors'))); +$temp->add(new admin_setting_configselect('logtosyslog', get_string('logtosyslog', 'admin'), get_string('configlogtosyslog', 'admin'), 0, array(0 => get_string('no'), LOG_LOCAL0 => 'LOG_LOCAL0', LOG_LOCAL1 => 'LOG_LOCAL1', LOG_LOCAL2 => 'LOG_LOCAL2', LOG_LOCAL3 => 'LOG_LOCAL3', LOG_LOCAL4 => 'LOG_LOCAL4', LOG_LOCAL5 => 'LOG_LOCAL5', LOG_LOCAL6 => 'LOG_LOCAL6', LOG_LOCAL7 => 'LOG_LOCAL7', LOG_USER => 'LOG_USER (Windows)'))); $temp->add(new admin_setting_configcheckbox('xmlstrictheaders', get_string('xmlstrictheaders', 'admin'), get_string('configxmlstrictheaders', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('debugsmtp', get_string('debugsmtp', 'admin'), get_string('configdebugsmtp', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('perfdebug', get_string('perfdebug', 'admin'), get_string('configperfdebug', 'admin'), '7', '15', '7')); Index: lang/en_utf8/admin.php =================================================================== RCS file: /cvsroot/moodle/moodle/lang/en_utf8/admin.php,v retrieving revision 1.197 diff -u -F ^f -r1.197 admin.php --- lang/en_utf8/admin.php 30 Jun 2008 11:12:23 -0000 1.197 +++ lang/en_utf8/admin.php 2 Jul 2008 06:54:57 -0000 @@ -148,6 +148,7 @@ $string['configlocale'] = 'Choose a sitewide locale - this will override the format and language of dates for all language packs (though names of days in calendar are not affected). You need to have this locale data installed on your operating system (eg for linux en_US.UTF-8 or es_ES.UTF-8). In most cases this field should be left blank.'; $string['configloginhttps'] = 'Turning this on will make Moodle use a secure https connection just for the login page (providing a secure login), and then afterwards revert back to the normal http URL for general speed. CAUTION: this setting REQUIRES https to be specifically enabled on the web server - if it is not then YOU COULD LOCK YOURSELF OUT OF YOUR SITE.'; $string['configloglifetime'] = 'This specifies the length of time you want to keep logs about user activity. Logs that are older than this age are automatically deleted. It is best to keep logs as long as possible, in case you need them, but if you have a very busy server and are experiencing performance problems, then you may want to lower the log lifetime.'; +$string['configlogtosyslog'] = 'If activated, messages will also be sent to the syslog facility chosen here. This is suitable for a larger site, and should not be activated in a shared hosting environment (where you might not have access to these logs). On a Unix environment, you can edit the file /etc/syslog.conf to define where messages go, per facility and severity. Note that on Windows, LOG_USER is the only facility available and that message will be shown in the Event Log.'; $string['configlongtimenosee'] = 'If students haven\'t logged in for a very long time, then they are automatically unsubscribed from courses. This parameter specifies that time limit.'; $string['configlookahead'] = 'Days to look ahead'; $string['configmailnewline'] = 'Newline characters used in mail messages. CRLF is required according to RFC 822bis, some mail servers do automatic conversion from LF to CRLF, other mail servers do incorrect conversion from CRLF to CRCRLF, yet others reject mails with bare LF (qmail for example). Try changing this setting if you are having problems with undelivered emails or double newlines.'; @@ -447,6 +448,7 @@ $string['log'] = 'Logs'; $string['loginhttps'] = 'Use HTTPS for logins'; $string['loglifetime'] = 'Keep logs for'; +$string['logtosyslog'] = 'Log to syslog'; $string['longtimenosee'] = 'Unsubscribe users from courses after'; $string['longtimewarning'] = 'Please note that this process can take a long time.'; $string['mail'] = 'Email'; Index: lib/setup.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/setup.php,v retrieving revision 1.239 diff -u -F ^f -r1.239 setup.php --- lib/setup.php 19 Jun 2008 22:27:12 -0000 1.239 +++ lib/setup.php 2 Jul 2008 06:54:58 -0000 @@ -239,6 +239,10 @@ die; } + if (!empty($CFG->logtosyslog)) { + openlog('moodle', LOG_ODELAY, $CFG->logtosyslog); + } + /// Shared-Memory cache init -- will set $MCACHE /// $MCACHE is a global object that offers at least add(), set() and delete() /// with similar semantics to the memcached PHP API http://php.net/memcache Index: lib/weblib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v retrieving revision 1.1094 diff -u -F ^f -r1.1094 weblib.php --- lib/weblib.php 25 Jun 2008 03:26:09 -0000 1.1094 +++ lib/weblib.php 2 Jul 2008 06:55:01 -0000 @@ -6922,6 +6922,9 @@ function debugging($message='', $level=D } else { trigger_error($message . $from, E_USER_NOTICE); } + if (!empty($CFG->logtosyslog)) { + syslog(LOG_NOTICE, $message); + } } return true; }