Closed jackric closed 7 years ago
I concur that it would be good to have a configurable timeout on the buffer (so log items spend at most x milliseconds in the buffer before being sent).
Others concur with you too and have opened an issue in the jsnlog project: https://github.com/mperdeck/jsnlog/issues/83
I would welcome a pull request. The timeout would have to be configurable (not fixed). Also, please keep your code change as small and simple as possible, so it is easy for me to review it and be comfortable that it works.
In the latest release 2.24.0, I introduced a new property on appenders "batchTimeout". Setting this (in ms) guarantees that a message won't sit in the batch buffer for longer than the given time out.
http://jsnlog.com/Documentation/Configuration/JSNLog/AjaxAppender http://jsnlog.com/Documentation/JSNLogJs/AjaxAppender/SetOptions
Current behaviour:
This caught me out for a while. I guess I assumed
batchSize
was there to be tweaked for performance with high frequency logging, and the appender would automatically drain.Proposed behaviour:
I understand the behaviour of an implementation is debatable. Happy to work on some pull requests if this otherwise seems sane.