tags:

views:

26

answers:

2

Hi,

I'm working on an archiving mechanism of my application's log files and would like some advice.

What I want to do: When receiving a LogEntry, the LogListenerService will save it in a buffer and at some point it will print all the log entries in a file. When the file reaches a certain size an archiving service is called that will zip the contents of the log files and clean it.

I've implemented most of the functionality but have some questions:

  1. How do I go about defining the ideal size of the buffer?
  2. How do I make sure the log file size is kept under a given "maximum size"?

Thanks

A: 

Answering my own question.. :)

  1. Depends on the application but the maximum memory an application can use is 16MB.
  2. Simply by adding a check before writing to the file (I was hoping for a cleverer way)
roul
A: 

Have you considered e.g. DroidDrop instead of rolling your own? (Caveat: haven't tested it myself yet.)

Pontus Gagge
Interesting, but I guess it doesn't exactly fit my need. Thanks for the link :)
roul