File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Logging + User Experience Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Logging + User Experience" Watch "Logging + User Experience" New topic
Author

Logging + User Experience

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208
Hi,

Any advice would be cool,

I am integrating logging into a web application,

The web application sends requests to a web service and then sends a log message to another web service,

But I want to send the log message to the logging web service without any affect to user experience,

So any advice to implement a buffer to group a number of logs together and then to flush the log messages to the web service after the log messages have reached a 100 log messages for example,

Cheers
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Could you explain what problem you are trying to solve here? "User experience" is a bit vague, specific questions are more practical.
Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208
Hi,

Thanks for your reply,

currently my application:
* has an instance of Log4J for writing log messages to a log file,
* the writing to the log file is quick because the logging file is on the same server

new implemenation:
* im going to change the logging merchanism to be sending HTTP requests to a server rather than writing to a log file
* if there is an issue with the server - then the sending of the HTTP request could take a long time and block the feedback to the user and will affect the user experience of the web application

so i'm thinking of batching the logs in groups of 100 and then sending the batch to the HTTP server without any affect to the user flow through the application

items that i'm looking at are:
* Spring Batch
* colllect the log messages in a java.util.ArrayList and then send the log content in a new Spring Task Executor in an aysnchronous mode

any ideas?

Cheers
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Other option: continue to use log4j. It can do asynchronous logging as written, and it can log to sockets as written. You could write your own HTTP appender if necessary.
 
Don't get me started about those stupid light bulbs.
 
subject: Logging + User Experience
 
Similar Threads
How to Increase Log level in Servlet
WARN level is not working
Syslog Msg & UDP Packet Size Limit
Single Signon with JAAS/SAML
singleton with thread and multiple VM's