• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Logging + User Experience

 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic