Logs

Apache logging

By default, LemonLDAP::NG uses Apache logs to store user actions and other messages:

The log level can be set with Apache LogLevel parameter. It can be configured globally, or inside a virtual host.

See http://httpd.apache.org/docs/2.2/mod/core.html#loglevel for more information.

To configure the user identifier in access log, go in Manager, General Parameters > Logging > REMOTE_USER.

Syslog

LemonLDAP::NG can also use syslog (only for user actions).

In Manager, set syslog facility in General Parameters > Logging > Syslog facility.

The messages are stored with the levels :

Trusted proxies IP

If users access Lemonldap::NG portal through a proxy, one may prefer log real client's IP instead of proxy's IP. Usually, proxies forward client IP in a “X-Forwarded-For” HTTP Header.

On the other hand, X-Forwarded-For header may be forged by user, so this may not be a reliable data.

You can manage Lemonldap::NG's behaviour in General Parameters > Logging > “Trusted proxies IP” :

Note that a proxy cannot add “X-Forwarded-For” headers if portal URL is a https URL.

Override logging functions

You can customize logs by redefining userNotice() and userError() methods, directly in lemonldap-ng.ini

Example:

[portal]
userError = sub { my ($self, $message) = @_; ... }
userNotice = sub { my ($self, $message) = @_; ... }