Log::Message::Structured::Component::Date
package MyLogEvent; use Moose; use namespace::autoclean; with qw/ Log::Message::Structured Log::Message::Structured::Component::Date /; has foo => ( is => 'ro', required => 1 ); ... elsewhere ... use aliased 'My::Log::Event'; $logger->log(message => Event->new( foo => "bar" )); # Logs: {"__CLASS__":"MyLogEvent","foo":1,"date":"2010-03-28T23:15:52Z"}
Provides 'epochtime' and 'date' attributes to the consuming class ( that should also consume Log::Message::Structured).
'epochtime'
'date'
The BUILD method is wrapped to make sure the date is inflated at construction time.
The date and time on which the event occured, as an ISO8601 date time string (from MooseX::Types::ISO8601). Defaults to the time the object is constructed.
The date and time on which the event occurred, as an no of seconds since Jan 1st 1970 (i.e. the output of time()). Defaults to the time the object is constructed.
Damien Krotkine (dams) <dams@cpan.org>.
<dams@cpan.org>
Licensed under the same terms as perl itself.
To install Log::Message::Structured, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Message::Structured
CPAN shell
perl -MCPAN -e shell install Log::Message::Structured
For more information on module installation, please visit the detailed CPAN module installation guide.