NAME

HeliosX::Logger::HiRes - Helios::Logger subclass implementing high resolution logging for Helios

SYNOPSIS

# in helios.ini, disable internal logging 
internal_logger=off
# and enable HeliosX::Logger::HiRes
loggers=HeliosX::Logger::HiRes

DESCRIPTION

Unlike some other Helios::Logger subclasses, HeliosX::Logger::HiRes intends not to link Helios with external logging systems, but to enhance Helios's own internal logging system by providing much more precise timestamping of log messages via the Time::HiRes module.

The Helios base system's logging subsystem only has resolution to the second, which keeps it consistent with the underlying TheSchwartz queueing system. But if your collective runs many short-lived (sub-second runtime) jobs, the ordering of log messages can easily get confused, with some log entries appearing after other messages that clearly came before. In order prevent this, HeliosX::Logger::HiRes uses the Perl Time::HiRes module to capture a much more precise measure of an entry's log time, and stores that time in a slightly modified Helios database schema that can handle the subsecond precision of the new time.

HELIOS DATABASE SCHEMA CHANGES

In order to handle the more precise timing information, HeliosX::Logger::HiRes requires minor changes to the Helios database schema. These changes will not alter the functionality of Helios::Panoptes or other utilities or Helios services not utilizing HeliosX::Logger::HiRes. To alter the database schema, connect to your MySQL Helios database and execute the commands in the sql/helios_hires.sql file. This will only affect the HELIOS_LOG_TB. Job history (HELIOS_JOB_HISTORY_TB) and service uptime monitoring (HELIOS_WORKER_REGISTRY_TB) will be unaffected.

IMPLEMENTED METHODS

init()

...is empty.

logMsg($job, $level, $msg)

This method effectively does the same thing as the original Helios logging code, but makes sure the log times recorded are subsecond times.

OTHER METHODS

getDriver()

Returns a Data::ObjectDriver object that can be used to write to the HELIOS_LOG_TB in the Helios database.

SEE ALSO

Helios::Service, Helios::Logger, Time::HiRes

AUTHOR

Andrew Johnson, <lajandy at cpan dotorg>

COPYRIGHT AND LICENSE

Copyright (C) 2009-11 by Andrew Johnson

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.