Accounting and
users logging
By default, Lemonldap::NG uses Apache logs to
store user actions. It can be change easily. Examples bellow works for
Lemonldap::NG version 0.9.4 and later.
Users logs on
portal
Lemonldap::NG portal logs :
- authentications (level "notice")
- logout (level "notice")
- bad user (level "warn")
- bad password (level "warn")
- session expired (level "debug")
To use syslog, you just have to set "syslog => '<facility>'"
in the new() subroutine. Example to log user actions with the facility
"auth" :
my $portal = Lemonldap::NG::Portal->new({
syslog => "auth",
…
});
You can customize this by redefining userNotice()
and userError() methods. Example :
my $portal = Lemonldap::NG::Portal->new({
userError => sub {
my ($self, $message) = @_;
# do something with $message
# Note that username is stored in $self->{user}
# and password in $self->{password}
},
userNotice => sub {
my ($self, $message) = @_;
# do something with $message
# Note that username is stored in $self->{user}
# and other datas are stored in $self->{sessionInfo}
},
…
});
Users logs on
handlers
Lemonldap::NG handlers logs :
- access forbidden (level "notice")
- access granted (level "debug")
To change logging, redefine the methods logForbidden() and
logGranted().