lemonldap-ng/doc/pages/documentation/1.9/logs.html
2015-12-18 09:46:34 +00:00

95 lines
3.5 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<!-- metadata -->
<meta name="generator" content="Offline" />
<meta name="version" content="Offline 0.1" />
<!-- style sheet links -->
<link rel="stylesheet" media="all" type="text/css" href="../../../css/all.css" />
<link rel="stylesheet" media="screen" type="text/css" href="../../../css/screen.css" />
<link rel="stylesheet" media="print" type="text/css" href="../../../css/print.css" />
</head>
<body>
<div class="dokuwiki export">
<h1 class="sectionedit1" id="logs">Logs</h1>
<div class="level1">
</div>
<!-- EDIT1 SECTION "Logs" [1-20] -->
<h2 class="sectionedit2" id="apache_logging">Apache logging</h2>
<div class="level2">
<p>
By default, LemonLDAP::NG uses Apache logs to store user actions and other messages:
</p>
<ul>
<li class="level1"><div class="li"> Error log: all messages emitted by the program, depending on the configured log level</div>
</li>
<li class="level1"><div class="li"> Access log: the issuer of each request is identified</div>
</li>
</ul>
<p>
The log level can be set with Apache <code>LogLevel</code> parameter. It can be configured globally, or inside a virtual host.
</p>
<p>
See <a href="http://httpd.apache.org/docs/2.2/mod/core.html#loglevel" class="urlextern" title="http://httpd.apache.org/docs/2.2/mod/core.html#loglevel" rel="nofollow">http://httpd.apache.org/docs/2.2/mod/core.html#loglevel</a> for more information.
</p>
<p>
To configure the user identifier in access log, go in Manager, <code>General Parameters</code> &gt; <code>Logging</code> &gt; <code>REMOTE_USER</code>.
</p>
</div>
<!-- EDIT2 SECTION "Apache logging" [21-607] -->
<h2 class="sectionedit3" id="syslog">Syslog</h2>
<div class="level2">
<p>
LemonLDAP::NG can also use syslog (only for user actions).
</p>
<p>
In Manager, set syslog facility in <code>General Parameters</code> &gt; <code>Logging</code> &gt; <code>Syslog facility</code>.
</p>
<p>
The messages are stored with the levels :
</p>
<ul>
<li class="level1"><div class="li"> <strong>info</strong> for user actions</div>
</li>
<li class="level1"><div class="li"> <strong>notice</strong> for good authentications or external exchange (<abbr title="Security Assertion Markup Language">SAML</abbr>, OpenID,…)</div>
</li>
<li class="level1"><div class="li"> <strong>warn</strong> for failed authentications</div>
</li>
</ul>
</div>
<!-- EDIT3 SECTION "Syslog" [608-976] -->
<h2 class="sectionedit4" id="override_logging_functions">Override logging functions</h2>
<div class="level2">
<p>
You can customize logs by redefining userNotice() and userError() methods, directly in <code>lemonldap-ng.ini</code>
</p>
<p>
Example:
</p>
<pre class="code file ini"><span class="re0"><span class="br0">&#91;</span>portal<span class="br0">&#93;</span></span>
<span class="re1">userError</span> <span class="sy0">=</span><span class="re2"> sub <span class="br0">&#123;</span> my <span class="br0">&#40;</span>$self, $message<span class="br0">&#41;</span> = @_</span><span class="co0">; ... }</span>
<span class="re1">userNotice</span> <span class="sy0">=</span><span class="re2"> sub <span class="br0">&#123;</span> my <span class="br0">&#40;</span>$self, $message<span class="br0">&#41;</span> = @_</span><span class="co0">; ... }</span></pre>
</div>
</div><!-- closes <div class="dokuwiki export">-->