Logging is a feature which is required for all real security systems. So we see the missing logging as a real problem for OpenCA and so we added it during the 0.9 series. The logging itself based on a slotmechanism to support as many different logging technoligies as possible.
$hash->{user_data}->{emailaddress} = "testuser@abc.com";
The hashreference must include a key CLASS which you can freely choose. This class can beused to filter messages and to decide which slot should be used.
EMERG
ALERT
CRIT
ERR
WARNING
NOTICE
INFO
DEBUG
OpenCA::Log::Message->new (HASHREF => $hash)
my $log_token = $crypto_layer->getToken ('LOG'); $log_token = $cryptoShell if ( not $log_token ); $log = OpenCA::Log->new (CONFIG => getRequired ('LogConfiguration'), CRYPTO => $log_token); $log->addMessage (OpenCA::Log::Message->new (HASHREF => $hash));
The configuration of the logging will usually done in etc/log.xml. Today there are two different logger implementation Syslog and XML. You can specify accepted class and level for every configured logger. Class and level accept wildcards.
The Syslog logger needs the type of the used Perl module. You can choose between Sys, Net, and Unix. Today only Sys is really tested. Additionaly you can specify a prefix for every log message. This is useful if you filter your logs with logsurfer or other tools. Please specify a facility too. This allows you to specify the behaviour of the syslogd via syslog.conf. If you use Sys then please specify the used socket type too. I used unix and it works all other types don't work on my linux box but it is better to allow the full flexibility and let it to the user to decide what he needs and uses.
The XML logger only has one option - dir. It specifies which directory the logger should use to establish the needed structure.