Excessive Logging

According to Murphy’s Law, your Hotel Management Software will crash on the most busy day of the year. ¬†Apparently it was not a crash which was easy to fix with some 1000 reboots of the server. Anyway, the crash was an error followed by a warning, followed by an error, followed by a warning…

As I browsed through the Error logs of the system (I am not ¬†a techincian on the hotel, therefore I can only investigate, not solve problem) I found that there was an activity log that was “full” and had to be backed up. The activity log apparently was used to monitor EVERY SINGLE CLICK in the system. The information held in the log was like this:

[username][date][time][workstation][activity][database query][explenatory text of what the query meant]

This shouldn’t be a problem, and it is rather logical keeping logs for some time, the problem here was that the log was NEVER reset! It kept records from 2006! This resulted in an enormous log of useless information (legally the hotel is not obliged to keep this kind of log) which was gathered over the years. The result was a file with size of 50GB! Occupying the whole hard disk where it was stored!

How much is this? The database containing the clients’ data (the usefull ones) was just 2 GB (also there there is the reastaurant charges, EVERYTHING that moved in the hotel from 2006). In comparison: A bit more of the WHOLE Wikipedia’s Database as of March of 2009!

wikipedia database size

After the initial shock, I contacted the technician responsible (who of course was on vacation) and asked him why there was so much logging. His answer was another shock:

“I have no idea. We bought the source code and rebranded the software. Frankly, we do not have examined the full behavior of the program.”

The solution was simple: “We have to delete the log file” – No shit, Sherlock.

Here’s my solution to them:

  • Keep a log within a reasonable amount of time (e.g. a year) Most of the employees found there had either retired or left the hotel
  • Keep the usefull data, like who logged in from where, and edits of the database. Keeping a record from just viewing the client’s profile is idiotic.
  • Clear the log if it exceeds some disk space.
  • Test run your f#*%ing code.