-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current Error Handling does not return false on logging errors #66
Comments
How about using fluency instead of fluent-logger-java? |
You can set an
As for the return value of
I guess fluent-logger didn't notice the buffer full of the Fluentd.
Unfortunately, fluent-logger doesn't support the feature and there is no plan to support it for now. But Fluency, which is yet another fluent logger, supports it https://github.com/komamitsu/fluency#enable-ack-response-mode. On the other hand, Fluency doesn't support custom error handler, but I'll implement the feature later. |
Fluency 1.4.0 now supports custom error handler and user can know and handle a send error. |
There are two types of errors I've run into:
Here I created an app to log to a remote Fluentd instance.
private static final FluentLogger LOG = FluentLogger.getLogger("audit", "10.0.0.1", 22224);
However, I forgot to start the remote Fluentd instance before running the app, so I got Network Errors
java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at org.fluentd.logger.sender.RawSocketSender.connect(RawSocketSender.java:85) at org.fluentd.logger.sender.RawSocketSender.reconnect(RawSocketSender.java:98) at org.fluentd.logger.sender.RawSocketSender.flush(RawSocketSender.java:206) at org.fluentd.logger.sender.RawSocketSender.send(RawSocketSender.java:195) at org.fluentd.logger.sender.RawSocketSender.emit(RawSocketSender.java:157) at org.fluentd.logger.sender.RawSocketSender.emit(RawSocketSender.java:139) at org.fluentd.logger.sender.RawSocketSender.emit(RawSocketSender.java:134) at org.fluentd.logger.FluentLogger.log(FluentLogger.java:101) at org.fluentd.logger.FluentLogger.log(FluentLogger.java:86) at LoggerInfra.log(FluentdLoggerApp.java:27) at LoggerCaller.testLogger(FluentdLoggerApp.java:79) at FluentdLoggerApp.main(FluentdLoggerApp.java:112)
There error was printed to console (expected because of limited error handling #15), but the
log()
call returnedtrue
instead offalse
which hid the internal failure.Result of logic in RawSocketSender.java#L204 which simple logs the error message to
LOG.error()
.log()
call returned true and the stack trace was printed out to terminal.The text was updated successfully, but these errors were encountered: