DigiSpark helps monitoring a log file

At work there was a problem with a tool that archives documents. Whenever that tool failed doing its task it would write an error code into a database table.
So some unfortunate user had to check that table for that error code about three times a day, would open that document in Word, save it and update the error code.

I got the order to write a program to automate the whole process. I used c#/.NET for the whole thing. The Task Scheduler would call this program every five minutes and would write its findings into a log.

Because I tested it I was pretty confident it would work smoothly. But what happened now was this: I would check the log regularly if my program picked up the wrong documents and corrected it. Instead of somebody checking the database for errors I would now check the log for the error indications!

So I wrote a second program – again in c#. It would check the log file and if it detected that the tool picked up and fixed a defect document it would then blink the DigiSpark‘s RGB led and turn from green to red. For this I used DigiStump’s DigiRgb.exe basically the same way I used it in my Minecraft mod.

I love it: It saves me a big amount of time of checking a log for something that hardly ever happens. Plus: It looks really cool on my desk 🙂

DigiSpark with RGB shield

DigiSpark indicating that all is good. If it detects an error log it blinks red ten times and then stays red until manually reset.

 

Leave a Reply

Your email address will not be published. Required fields are marked *