Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asynchronous non-blocking remote logging in Java?

Is there a lightweight logging framework/server I can use to setup remote logging in Java? I know log4j has SocketAppenders but a) I want a library that is more out of the box where I can simply run a log server, b) I want the logging calls to be completely asynchronous non-blocking from the rest of the code and c) A nice web based dashboard/viewer on the log-server would be also nice

like image 765
pathikrit Avatar asked Feb 17 '12 13:02

pathikrit


People also ask

What is difference between asynchronous and non blocking?

Non-Blocking: It refers to the program that does not block the execution of further operations. Non-Blocking methods are executed asynchronously. Asynchronously means that the program may not necessarily execute line by line.

What is blocking and non blocking in Java?

Java IO's various streams are blocking. It means when the thread invoke a write() or read(), then the thread is blocked until there is some data available for read, or the data is fully written. Non blocking I/O. Non blocking IO does not wait for the data to be read or write before returning.

Is blocking synchronous method?

Summary: Blocking is always synchronous. Synchronous call have blocking operations if it waits for some event to get complete, caller method may enter wait state. Synchronous call is non blocking, if it repeatedly check for some event to occur before proceeding for next instruction.

What is non blocking request?

Non-blocking means that if an answer can't be returned rapidly, the API returns immediately with an error and does nothing else. So there must be some related way to query whether the API is ready to be called (that is, to simulate a wait in an efficient way, to avoid manual polling in a tight loop).


1 Answers

You could use log4j with a SyslogAppender and use some tool for viewing the syslog(-ng). Use the async appender wrapper that ships with log4j, a nice article about that can be found here.

like image 157
Ortwin Angermeier Avatar answered Nov 15 '22 00:11

Ortwin Angermeier