He's using a content-type, but it's 'text/plain'. HTML tags would be a bad thing to do, if the file isn't going to be interpreted as HTML. (text/html,
text/xhtml, text/xhtml+xml, etc)
The problem is, he's given us the code for what generates the log, and not for what displays it. I think you're right, in that it's being displayed as HTML, and not using HTML line endings. The easiest solution is to make sure that the browser is sending the correct mime headers when viewing the logs.
I'd probably also use common+ log format (aka. NCSA extended log format) , as it would allow you to use existing log analysis packages (eg, analog) for those pretty graphs that management likes
(well, I'd use the format, but I'd do it in the server, rather than generating a new process just to log)
Update: follow the link that dorward gave for the correct xhtml mime type