Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiwara committed Jan 30, 2012
1 parent a468c11 commit 76302fb
Showing 1 changed file with 47 additions and 28 deletions.
75 changes: 47 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,22 @@ Fluent::Logger - A structured event logger for Fluent
use Fluent::Logger;


my $logger = Fluent::Logger->new(host => '127.0.0.1', port => 24224);
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);
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"}

# WARNING

__This software is under the heavy development and considered ALPHA
quality till the version hits v1.0.0. Things might be broken, not all
features have been implemented, and APIs will be likely to change. YOU
HAVE BEEN WARNED.__

## TODO

- * buffering and pending

- * timeout, reconnect

- * write pod

- * test cases

# DESCRIPTION

Fluent::Logger is a structured event logger for Fluent.
Expand All @@ -45,36 +35,65 @@ 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
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.
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

# REPOSITORY

<https://github.com/hirose31/fluent-logger-perl>
[https://github.com/fluent/fluent-logger-perl](https://github.com/fluent/fluent-logger-perl)

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

patches and collaborators are welcome.

# SEE ALSO

<http://fluent.github.com/>
[http://fluent.github.com/](http://fluent.github.com/)

# COPYRIGHT & LICENSE

Copyright HIROSE Masaaki
Copyright FUJIWARA Shunichiro

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

0 comments on commit 76302fb

Please sign in to comment.