Best way to convert log files (*.txt) to web-friendly files (*.html, *.jsp, etc)?

Posted by prometheus on Stack Overflow See other posts from Stack Overflow or by prometheus
Published on 2010-03-12T19:13:35Z Indexed on 2010/03/12 19:17 UTC
Read the original article Hit count: 143

Filed under:
|
|
|
|

I have a bunch of log files which are pure text. Here is an example of one...

Overall Failures Log
SW Failures - 03.09.2010 - /logs/swfailures.txt - 23 errors - 24 warnings
HW Failures - 03.09.2010 - /logs/hwfailures.txt - 42 errors - 25 warnings
SW Failures - 03.10.2010 - /logs/swfailures.txt - 32 errors - 27 warnings
HW Failures - 03.10.2010 - /logs/hwfailures.txt - 11 errors - 31 warnings

These files can get quite large and contain a lot of other information. I'd like to produce an HTML file from this log that will add links to key portions and allow the user to open up other log files as a result...

SW Failures - 03.09.2010 - <a href="/logs/swfailures.txt">/logs/swfailures.txt</a> - 23 errors - 24 warnings

This is greatly simplified as I would like to add many more links and other html elements. My question is -- what is the best way to do this? If the files are large, should I generate the html before serving it to the user or will jsp do? Should I use perl or other scripting languages to do this? What are your thoughts and experiences?

© Stack Overflow or respective owner

Related posts about web-development

Related posts about html