The Perl Toolchain Summit 2025 Needs You: You can help 🙏 Learn more

NAME

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

SYNOPSIS

package MyLogEvent;
use Moose;
with qw/
Log::Message::Structured::Component::Hostname
/;
has foo => ( is => 'ro', required => 1 );
... elsewhere ...
$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.