Git Product home page Git Product logo

fluent-logger-perl's Introduction

NAME

Fluent::Logger - A structured event logger for Fluent

SYNOPSIS

use Fluent::Logger;


my $logger = Fluent::Logger->new(
    host => '127.0.0.1',
    port => 24224,
);
$logger->post("myapp.access", { "agent" => "foo" });
# output: myapp.access {"agent":"foo"}


my $logger = Fluent::Logger->new(
    tag_prefix => 'myapp',
    host       => '127.0.0.1',
    port       => 24224,
);
$logger->post("access", { "agent" => "foo" });
# output: myapp.access {"agent":"foo"}

DESCRIPTION

Fluent::Logger is a structured event logger for Fluent.

METHODS

  • new(%args)

    create new logger instance.

    %args:

      tag_prefix     => 'Str':  optional
      host           => 'Str':  default is '127.0.0.1'
      port           => 'Int':  default is 24224
      timeout        => 'Num':  default is 3.0
      socket         => 'Str':  default undef (e.g. "/var/run/fluent/fluent.sock")
      prefer_integer => 'Bool': default 1 (set to Data::MessagePack->prefer_integer)
    
  • post($tag:Str, $msg:HashRef)

    Send message to fluent server with tag.

    Return bytes length of written messages.

  • post_with_time($tag:Str, $msg:HashRef, $time:Int)

    Send message to fluent server with tag and time.

  • close()

    close connection.

    If the logger has pending data, flushing it to server on close.

  • errstr

    return error message.

      $logger->post( info => { "msg": "test" } )
          or die $logger->errstr;
    

AUTHOR

HIROSE Masaaki <hirose31 _at_ gmail.com>

Shinichiro Sei <sei _at_ kayac.com>

FUJIWARA Shunichiro <fujiwara _at_ cpan.org>

THANKS TO

Kazuki Ohta

FURUHASHI Sadayuki

lestrrat

REPOSITORY

https://github.com/fluent/fluent-logger-perl

git clone git://github.com/fluent/fluent-logger-perl.git

patches and collaborators are welcome.

SEE ALSO

http://fluent.github.com/

COPYRIGHT & LICENSE

Copyright FUJIWARA Shunichiro

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.