File Locking

C

Chris Korhonen

Hi,

I'm currently developing a "quick and dirty" logger component that will
take HTTP requests and store them in some way. Use of a database may be
out of the question for the time being, so I'm looking for other places
to store the data. The obvious idea is in a XML/text file on my server,
using JSP to do the actually logging. So far so good...

Only problem is that its quite likely that it will be recieving high
volumes (>1 per second) of data which will need to be logged.

Given this, will I run into any issues regarding file locking etc. Can
any of you guys recommend any possible alternatives/workarounds for
this?

Regards
Chris
 
J

jcsnippets.atspace.com

Chris Korhonen said:
Hi,

I'm currently developing a "quick and dirty" logger component that will
take HTTP requests and store them in some way. Use of a database may be
out of the question for the time being, so I'm looking for other places
to store the data. The obvious idea is in a XML/text file on my server,
using JSP to do the actually logging. So far so good...

Only problem is that its quite likely that it will be recieving high
volumes (>1 per second) of data which will need to be logged.

Given this, will I run into any issues regarding file locking etc. Can
any of you guys recommend any possible alternatives/workarounds for
this?

Rather than developing a new logger component, have you already had a look
at Log4j (http://logging.apache.org/log4j/docs/) ?

It's fast, reliable, open-source, rather easy to setup and use, and it has
already proven it's use in various projects.

As for the high volumes, here's a bit of text from the website itself:
"Actual logging is also quite fast, ranging from 21 microseconds using the
SimpleLayout, 37 microseconds using the TTCCLayout." .

For a "quick and dirty" logger, the SimpleLayout is more than sufficient.

If you're really interested in a smaller, simpler logger, just reply, I'll
dig one up.

Regards,

JC
 
C

Chris Korhonen

Cheers, I'm actually looking at Log4J at the moment, and it looks likes
it will do everything I need, I may even strip it down a bit just too
simplify things even more.

I'll see how it copes with the input, as I said I'll be building this
into a JSP function initially, possibly migrating to servlet later on.
I'm just a tad concerned as it will be recieving potentially
simultanious requests.

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top