? .hg ? .hgignore ? lang/en_utf8/grep Index: admin/settings/server.php =================================================================== RCS file: /cvsroot/moodle/moodle/admin/settings/server.php,v retrieving revision 1.38 diff -u -F ^f -r1.38 server.php --- admin/settings/server.php 25 Mar 2008 02:23:37 -0000 1.38 +++ admin/settings/server.php 26 Mar 2008 01:53:20 -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.192 diff -u -F ^f -r1.192 admin.php --- lang/en_utf8/admin.php 15 Mar 2008 16:10:32 -0000 1.192 +++ lang/en_utf8/admin.php 26 Mar 2008 01:53:28 -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. Note that LOG_USER is the only one available on Windows.'; $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.'; @@ -441,6 +442,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.226 diff -u -F ^f -r1.226 setup.php --- lib/setup.php 11 Mar 2008 09:05:20 -0000 1.226 +++ lib/setup.php 26 Mar 2008 01:53:32 -0000 @@ -291,6 +291,10 @@ @ini_set('log_errors', '1'); } + 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.1048 diff -u -F ^f -r1.1048 weblib.php --- lib/weblib.php 20 Mar 2008 07:05:06 -0000 1.1048 +++ lib/weblib.php 26 Mar 2008 01:53:43 -0000 @@ -6917,6 +6917,9 @@ function debugging($message='', $level=D } else { trigger_error($message . $from, E_USER_NOTICE); } + if (!empty($CFG->logtosyslog)) { + syslog(LOG_NOTICE, $message); + } } return true; }