fluent-logger-php icon indicating copy to clipboard operation
fluent-logger-php copied to clipboard

Feature Request - batch logging in FluentLogger->post() function

Open aacanakin opened this issue 12 years ago • 4 comments

Hello, I want to be able to write batch logs (50 items) atomically. Currently, I'm posting logs in foreach loop in batch requests. However, if td agent stops unexpectedly, I need to write the complete request(50 items) to csv. Is it possible in the current code base ? Does fluentd interface support batch logging ?

Thanks Aras

aacanakin avatar Feb 05 '14 11:02 aacanakin

AFAIK, fluentd doesn't have such interface. in_tail might solve your concerns. I recommend to use in_tail and FileLogger if you can switch fluentd configuration.

http://docs.fluentd.org/articles/in_tail

Basically, PHP is poor about back ground task like sending metrics data. It's PHP architecture design. But it can improve with C extension. I'll plan to add async logger this year.

chobie avatar Feb 05 '14 12:02 chobie

Yes, this does improve performance. curl is always faster than file_get_contents.

disq avatar Mar 17 '14 08:03 disq

FYI: For now, you can use Embulk for batch operations. Embulk is designed for batch operations.

cosmo0920 avatar Aug 27 '15 09:08 cosmo0920

This issue seems to request micro-batch forward, not Embulk like huge batching.

in_forward accepts multiple events in one request so supporting this is good for some users. http://docs.fluentd.org/articles/in_forward#protocol

repeatedly avatar Aug 27 '15 09:08 repeatedly