H have some (log4j generated) logfiles to go through; I know their format pretty well (I mean I have already got off-the-peg regexes etc I can use).
I want to automatically highlight them in VIM when I load them up (*.log).
A logfile entry looks something like this:
YYYY-MM-DD HH:MM:ss,SSS [...] #LOG-LEVEL# [...] Message
Where #LOG-LEVEL# is one of the standard 'ERROR', 'INFO', 'DEBUG', 'FATAL'....and the 'YYYY-MM...' represents the date/time to millisecond resolution.
To get me started , what are the steps needed to get the date-string highlighted in (say) yellow-background with blue text - and also when the text reads ' ERROR ' this should have a red-background with white text.
I have tried going through some tutorials on this, but can't find one which is simple enough to understand, so I'm after some real basic steps here !
Cheers
EDIT: Here's the summary of what I did, based on the instructions below:
Created the syntax file 'log.vim' in .vim\syntax (see below for example content).
Created a file in .vim\ftdetect\log.vim with the following content:
au BufRead,BufNewFile *.log set filetype=log
Made sure the following are in my startup settings:
syntax on filetype on