Apache log intergration. In apache conf file one can use ${MOODULEUSER}n in LogFormat to get the current logged in username in moodle. Implemented by Patrick Li.

This commit is contained in:
martinlanghoff 2005-05-16 02:51:05 +00:00
parent 8465c58a8d
commit a559eee64e
2 changed files with 15 additions and 0 deletions

View file

@ -209,6 +209,15 @@ php_value post_max_size 2M
<pre>cp lib/htaccess .htaccess</pre>
</blockquote>
</blockquote>
<blockquote>
<p>(Optional) To include the username of the current user in the Apache access log, add the following into your httpd.conf:</p>
<blockquote>
<pre>
LogFormat "%h %l %{MOODLEUSER}n %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" moodle
CustomLog "/your/path/to/log" moodle</pre>
</blockquote>
<p>And then replace the "/your/path/to/log" to your http access log or to a new one. If your Moodle copy runs in a virtual host, add the lines in the corresponding <VirtualHost> block. Please refer to the Apache documentation for more information.</p>
</blockquote>
<p>&nbsp;</p>
<h3 class="sectionheading"><a name="database"></a>4.2 Creating a database</h3>

View file

@ -409,6 +409,12 @@ global $THEME;
}
}
/// Apache log intergration. In apache conf file one can use ${MOODULEUSER}n in
/// LogFormat to get the current logged in username in moodle.
if ($USER && function_exists('apache_note')) {
apache_note('MOODLEUSER', $USER->username);
}
/***
*** init_performance_info() {
***