I'm not quite sure I understand your question, but if you mean to serve the logs on the web, you could decide to leave the logs in plain text, and not bother with HTML at all.
print "Content-Type: text/plain\n\n"; and then you can read from the log file and print it to stdout.