{"id":23754015,"url":"https://github.com/fluent/fluent-logger-perl","last_synced_at":"2025-10-29T07:30:49.562Z","repository":{"id":1874844,"uuid":"2800167","full_name":"fluent/fluent-logger-perl","owner":"fluent","description":"A structured logger for Fluentd (Perl)","archived":false,"fork":false,"pushed_at":"2024-08-16T04:13:05.000Z","size":149,"stargazers_count":44,"open_issues_count":2,"forks_count":16,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-02-06T18:27:50.681Z","etag":null,"topics":["fluentd","fluentd-logger","perl"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dmytrodanylyk/folding-plugin","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluent.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-11-18T02:31:53.000Z","updated_at":"2025-01-02T21:05:10.000Z","dependencies_parsed_at":"2024-08-17T05:45:10.273Z","dependency_job_id":null,"html_url":"https://github.com/fluent/fluent-logger-perl","commit_stats":{"total_commits":125,"total_committers":16,"mean_commits":7.8125,"dds":"0.19999999999999996","last_synced_commit":"90840439f9e1e4995adc3198d2816a97c0b3e6af"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-logger-perl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-logger-perl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-logger-perl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-logger-perl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluent","download_url":"https://codeload.github.com/fluent/fluent-logger-perl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238592803,"owners_count":19497797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fluentd","fluentd-logger","perl"],"created_at":"2024-12-31T18:50:27.627Z","updated_at":"2025-10-29T07:30:44.246Z","avatar_url":"https://github.com/fluent.png","language":"Perl","readme":"[![Actions Status](https://github.com/fluent/fluent-logger-perl/workflows/test/badge.svg)](https://github.com/fluent/fluent-logger-perl/actions)\n# NAME\n\nFluent::Logger - A structured event logger for Fluent\n\n# SYNOPSIS\n\n    use Fluent::Logger;\n    \n    my $logger = Fluent::Logger-\u003enew(\n        host =\u003e '127.0.0.1',\n        port =\u003e 24224,\n    );\n    $logger-\u003epost(\"myapp.access\", { \"agent\" =\u003e \"foo\" });\n    # output: myapp.access {\"agent\":\"foo\"}\n    \n    my $logger = Fluent::Logger-\u003enew(\n        tag_prefix =\u003e 'myapp',\n        host       =\u003e '127.0.0.1',\n        port       =\u003e 24224,\n    );\n    $logger-\u003epost(\"access\", { \"agent\" =\u003e \"foo\" });\n    # output: myapp.access {\"agent\":\"foo\"}\n\n# DESCRIPTION\n\nFluent::Logger is a structured event logger for Fluentd.\n\n# METHODS\n\n- **new**(%args)\n\n    create new logger instance.\n\n    %args:\n\n        tag_prefix                  =\u003e 'Str':  optional\n        host                        =\u003e 'Str':  default is '127.0.0.1'\n        port                        =\u003e 'Int':  default is 24224\n        timeout                     =\u003e 'Num':  default is 3.0\n        socket                      =\u003e 'Str':  default undef (e.g. \"/var/run/fluent/fluent.sock\")\n        prefer_integer              =\u003e 'Bool': default 1 (set to Data::MessagePack-\u003eprefer_integer)\n        utf8                        =\u003e 'Bool': default 1 (set to Data::MessagePack-\u003eutf8)\n        event_time                  =\u003e 'Bool': default 0 (timestamp includes nanoseconds, supported by fluentd \u003e= 0.14.0)\n        buffer_limit                =\u003e 'Int':  defualt 8388608 (8MB)\n        buffer_overflow_handler     =\u003e 'Code': optional\n        truncate_buffer_at_overflow =\u003e 'Bool': default 0\n        ack                         =\u003e 'Bool': default 0 (not works on MSWin32)\n        retry_immediately           =\u003e 'Int':  default 0 (retries immediately  N times on error occured)\n\n    - buffer\\_overflow\\_handler\n\n        You can inject your own custom coderef to handle buffer overflow in the event of connection failure.\n        This will mitigate the loss of data instead of simply throwing data away.\n\n        Your proc should accept a single argument, which will be the internal buffer of messages from the logger.\n        This coderef is also called when logger.close() failed to flush the remaining internal buffer of messages.\n        A typical use-case for this would be writing to disk or possibly writing to Redis.\n\n    - truncate\\_buffer\\_at\\_overflow\n\n        When truncate\\_buffer\\_at\\_overflow is true and pending buffer size is larger than buffer\\_limit, post() returns undef.\n\n        Pending buffer still be kept, but last message passed to post() is not sent and not appended to buffer. You may handle the message by other method.\n\n    - ack\n\n        post() waits ack response from server for each messages.\n\n        An exception will raise if ack is miss match or timed out.\n\n        This option does not work on MSWin32 platform currently, because Data::MessagePack::Stream does not work.\n\n    - retry\\_immediately\n\n        By default, Fluent::Logger will retry to send the buffer at next post() called when an error occured in post().\n\n        If retry\\_immediately(N) is set, retries immediately max N times.\n\n- **post**($tag:Str, $msg:HashRef)\n\n    Send message to fluent server with tag.\n\n    Return bytes length of written messages.\n\n    If event\\_time is set to true, log's timestamp includes nanoseconds.\n\n- **post\\_with\\_time**($tag:Str, $msg:HashRef, $time:Int|Float)\n\n    Send message to fluent server with tag and time.\n\n    If event\\_time is set to true, $time argument accepts Float value (such as Time::HiRes::time()).\n\n- **close**()\n\n    close connection.\n\n    If the logger has pending data, flushing it to server on close.\n\n- **errstr**\n\n    return error message.\n\n        $logger-\u003epost( info =\u003e { \"msg\": \"test\" } )\n            or die $logger-\u003eerrstr;\n\n# AUTHOR\n\nHIROSE Masaaki \u0026lt;hirose31 \\_at\\_ gmail.com\u003e\n\nShinichiro Sei \u0026lt;sei \\_at\\_ kayac.com\u003e\n\nFUJIWARA Shunichiro \u0026lt;fujiwara \\_at\\_ cpan.org\u003e\n\n# THANKS TO\n\nKazuki Ohta\n\nFURUHASHI Sadayuki\n\nlestrrat\n\n# REPOSITORY\n\n[https://github.com/fluent/fluent-logger-perl](https://github.com/fluent/fluent-logger-perl)\n\n    git clone git://github.com/fluent/fluent-logger-perl.git\n\npatches and collaborators are welcome.\n\n# SEE ALSO\n\n[http://fluent.github.com/](http://fluent.github.com/)\n\n# COPYRIGHT \u0026 LICENSE\n\nCopyright FUJIWARA Shunichiro\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluent%2Ffluent-logger-perl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluent%2Ffluent-logger-perl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluent%2Ffluent-logger-perl/lists"}