Ticket #20 (assigned improvement)

Opened 2 years ago

Last modified 2 years ago

Improve Log::Log4perl support

Reported by: kindlund Assigned to: kindlund (accepted)
Priority: normal Milestone: 1.1
Component: HoneyClient::Manager Version: none
Severity: none Keywords: logging
Cc:

Description

With the exception of !HoneyClient::Manager::VM, this component and all child subcomponents have sparse logging.

Task: This module and all its child submodules need to have improved Log::Log4perl support, in order to enable remote auditing. This means that every package needs to follow the following example:

# This package initializes the global logging facility.
use HoneyClient::Util::Config;

# Include Logging Library
use Log::Log4perl qw(:easy);

# The global logging object.
our $LOG = get_logger();

# Transform all 'print' statements, into one of the following:
$LOG->debug('debug messages');
$LOG->info('information messages/notices');
$LOG->warn('warnings');
$LOG->error('known errors that occur, but do not cause the code to return/exit abnormally');
$LOG->fatal('unknown errors that cause the code to return/exit abnormally');

See this article for more information about how to use this logging system.

Attachments

Change History

11/05/06 04:36:10 changed by kindlund

  • status changed from new to assigned.

One note: If you decide to use Data::Dumper to output a debug entry, like:

$LOG->debug(Dumper(\%hash))

Then, be sure to enforce a 1-line Dumper format, so that the dumped data appears on a single line of the Log4perl output. This can be accomplished, by adding the following lines right before the debug() statement:

# Make Dumper format more terse.
$Data::Dumper::Terse = 1;
$Data::Dumper::Indent = 0;
$LOG->debug(Dumper(\%hash))

Add/Change #20 (Improve Log::Log4perl support)




Change Properties
Action