eris::log - Structured log or event object implementation
version 0.007
The unstructured log or event as passed to the contextualizer.
Hash of hashes built by the eris::log::decoders-decode()> step.
Compressed hash built by the eris::log::contexts-contextualize> step. Contexts are called in order by priority. As each context runs, it's possible to clobber the context key of a previous context. This represents the final state of the compressed namespace for the structured event.
Also populated by the eris::log::contexts-contextualize> step, but uses a first level key of the context name to preserve where information originated and protect duplicate keys.
ArrayRef storing hash references representing the time each step of the contextualizer took while turning the unstructured event into a structured one.
[ { phase => 'context::sshd', seconds => 0.0003 }, ]
Add new timings using the add_timings method like:
$log->add_timing( thing => 0.212 );
ArrayRef of tags to index with the doc. Add new tags with the add_tags method.
Stores the time the entire process took as a single element.
Required: The numeric representation of the time since the UNIX Epoch. Can be an integer or float. This is required to index the log in the right time.
Provided to override the type in the schema if being sent to Elasticsearch.
You probably shouldn't use this just set a default_type in your schema. Elastic's official docs recommend a single type per index.
Optional GUID representation. If set will be passed along to Elasticsearch as the document _id, otherwise Elasticsearch will autogenerate it.
Unless you know what you're doing, you probably shouldn't set this in your contexts or schemas.
Takes two parameters: context name as a string, a hash reference containing the context to add
Use this to add add context data in your own eris::role::context plugins:
sub contextualize_message { my ($self,$log) = @_; $log->add_context( $self->name, { static_key => "static values are shocking" } )l }
Takes a list of string tags to add to the object. Dedupes and adds new tags to the object.
Takes a hash of timing data to add to the timing store. This is called by the eris::log::contexts, eris::log::decoders, and eris::log::contextualizer automatically. You probably never need to call this method yourself.
Arguments parsed from a hash:
Boolean, default false. If set to true, the document is sourced for the eris::log complete event with the context namespaces as first level keys is returned. By default the eris::log context hash is returned which is a merged set of keys from all contexts.
eris::log
Do we flatten the key space using Hash::Flatten. This defaults to false see the differences:
# Default (false) { a => { b => 0, c => 1, } } # Flatten (true) { a.b => 0, a.c => 1, }
eris::log::contextualizer, eris::log::decoders, eris::log::contexts
Brad Lhotsky <brad@divisionbyzero.net>
This software is Copyright (c) 2015 by Brad Lhotsky.
This is free software, licensed under:
The (three-clause) BSD License
To install eris, copy and paste the appropriate command in to your terminal.
cpanm
cpanm eris
CPAN shell
perl -MCPAN -e shell install eris
For more information on module installation, please visit the detailed CPAN module installation guide.