Damien Krotkine > Log-Message-Structured-0.011 > Log::Message::Structured::Component::Hostname

Download:
Log-Message-Structured-0.011.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source   Latest Release: Log-Message-Structured-0.012

NAME ^

Log::Message::Structured::Component::Hostname

SYNOPSIS ^

    package MyLogEvent;
    use Moose;
    use namespace::autoclean;

    with qw/
        Log::Message::Structured
        Log::Message::Structured::Component::Hostname
    /;

    has foo => ( is => 'ro', required => 1 );

    ... elsewhere ...

    use aliased 'My::Log::Event';

    $logger->log(message => Event->new( foo => "bar" ));
    # Logs:
    {"__CLASS__":"MyLogEvent","foo":1,"hostname":"mymachine.domain"}

DESCRIPTION ^

Provides a 'hostname' attribute to the consuming class ( probably Log::Message::Structured).

ATTRIBUTES ^

hostname

The host name of the host the event was generated on. Defaults to the hostname as returned by Sys::Hostname.

AUTHOR AND COPYRIGHT ^

Damien Krotkine (dams) <dams@cpan.org>.

LICENSE ^

Licensed under the same terms as perl itself.

syntax highlighting: