Debugging Tools Software Debug

Application Logging Improvement – Part 3 Making it Readable

By Creating vim syntax file, machine readable logs can be made human readable. There are other ways to do this too and i just give an example of using vim. User can make necessary adjustments for color, format and what not.


First thing is configure vim to recognize the format. We create that in ftdetect directory. I use my home directory to store all of this but it can be moved to system directory or another directory for application’s usage and sourced it from there. Lets say our log files have “.mylog” as extension. So we create .vim/ftdetect/mylog.vim with following content.

au BufRead,BufNewFile *.mylog set filetype=mylog

Next is to create syntax file which will change log visually to make it more readable. By coloring errors or fatal messages in red it will keep the focus of viewer. Other things can go in different colors. So we create .vim/syntax/mylog.vim with following content. This will give some idea on what is going on and can be updated to suite ones taste.

That’s it folks.