Server Log Script, Draft #1

9 Jan

Here’s the first real addition to the code repository.

Server Log script, draft 1,

also it’s up on the code repository page

It runs, but I’m already working on improvements (there are some problems with all my servers being on different machines but I’ll describe all that in the next post, right after this one).

Here’s what it does:

  • reads the server.log file
  • echos it right to the page
  • all straight php

Here’s what it’ll do once I get those improvements:

  • put each line from the server.log file into a mysql database
  • the lines get logged with the time from the server.log file
  • then the lines get reverse sorted by time
  • read out the lines after the reverse sort

After the improvements the page will show the server log with the most recent activity at the top. Also, since it’s using mysql I can put a form at the top that allows someone to specify the number of lines that get displayed to screen (with some default value).

Leave a comment