I've written an application that logs trace data from an embedded system via UDP. Currently I receive datagrams and parse out the variable length records and store them in a list. The front end can access the list and present the data (graphs and text lists etc).
The problem I'm running into is that sometimes I need to log an exceptional amount of data. So much that my list implementation causes an out of memory exception.
My requirements are:
Does anyone have some suggestions about how to attack this? Here were a few thoughts that I had:
A local database really would be a nice way to handle this - especially because queries would aid with your investigation of logs. Plus, then your UDP receiving program could just be a separate thread that spits information at the database (if your data's REALLY fast-paced, you could have two buffers and alternate between them; flush the full buffer to the database while the other one is filling up). It really depends on the scale of your project though.
You could always use your third option (storing to a file right away), and have a separate "Log Investigation" tool that reads that file in without running into OOM exceptions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With