Skip to content

Instantly share code, notes, and snippets.

@mmdemirbas
Created September 13, 2012 11:34
Star You must be signed in to star a gist
Save mmdemirbas/3713724 to your computer and use it in GitHub Desktop.
Custom log file syntax highlighting for Notepad++
<NotepadPlus>
<UserLang name="LogFile" ext="log">
<Settings>
<Global caseIgnored="yes" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">[(0])0</Keywords>
<Keywords name="Folder+"></Keywords>
<Keywords name="Folder-"></Keywords>
<Keywords name="Operators">&apos; - ! &quot; # $ % &amp; ( ) * , . / : ; ? @ [ \ ] ^ _ ` { | } ~ + &lt; = &gt;</Keywords>
<Keywords name="Comment">1 2 0</Keywords>
<Keywords name="Words1">ERROR</Keywords>
<Keywords name="Words2">WARN WARNING</Keywords>
<Keywords name="Words3">DEBUG</Keywords>
<Keywords name="Words4">INFO</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD1" styleID="5" fgColor="FFFFFF" bgColor="FF0000" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD2" styleID="6" fgColor="FFFFFF" bgColor="FF8000" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD3" styleID="7" fgColor="FFFFFF" bgColor="FF80FF" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD4" styleID="8" fgColor="FFFFFF" bgColor="0080FF" fontName="" fontStyle="0" />
<WordsStyle name="COMMENT" styleID="1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="NUMBER" styleID="4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="OPERATOR" styleID="10" fgColor="FF0080" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="DELIMINER1" styleID="14" fgColor="000000" bgColor="FFFFBF" fontName="" fontStyle="1" />
<WordsStyle name="DELIMINER2" styleID="15" fgColor="800000" bgColor="FFFFFF" fontName="" fontStyle="2" />
<WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
</Styles>
</UserLang>
</NotepadPlus>
@barser
Copy link

barser commented Jul 26, 2016

Thanks for sharing!

@shpil95
Copy link

shpil95 commented Aug 2, 2016

thanks!

@foreachthing
Copy link

foreachthing commented Sep 9, 2016

Thank you!
But since I use a dark theme, I had to change some values:
<Styles> <WordsStyle name="DEFAULT" styleID="11" fgColor="DCDCCC" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" /> <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="DCDCCC" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" /> <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="DCDCCC" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" /> <WordsStyle name="KEYWORD1" styleID="5" fgColor="FFFFFF" bgColor="FF0000" fontName="" fontStyle="1" /> <WordsStyle name="KEYWORD2" styleID="6" fgColor="FFFFFF" bgColor="FF8000" fontName="" fontStyle="1" /> <WordsStyle name="KEYWORD3" styleID="7" fgColor="FFFFFF" bgColor="FF80FF" fontName="" fontStyle="1" /> <WordsStyle name="KEYWORD4" styleID="8" fgColor="FFFFFF" bgColor="0080FF" fontName="" fontStyle="2" /> <WordsStyle name="COMMENT" styleID="1" fgColor="DCDCCC" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" /> <WordsStyle name="COMMENT LINE" styleID="2" fgColor="DCDCCC" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" /> <WordsStyle name="NUMBER" styleID="4" fgColor="DCDCCC" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" /> <WordsStyle name="DELIMINER1" styleID="14" fgColor="DCDCCC" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="1" /> <WordsStyle name="DELIMINER2" styleID="15" fgColor="F08C00" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="2" /> <WordsStyle name="DELIMINER3" styleID="16" fgColor="DCDCCC" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" /> <WordsStyle name="OPERATOR" styleID="10" fgColor="FF7480" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="1" /> </Styles>

@MikeshCZ
Copy link

MikeshCZ commented Nov 4, 2016

Thank you a lot for sharing!

@ayakout
Copy link

ayakout commented Jan 26, 2017

Thanks for sharing. Really useful.
Always wanted some log highlighter to ship by default in np++ may be yours is a good candidate.

@noamgot
Copy link

noamgot commented Jun 8, 2017

This is great, thanks!

@amanjosan2008
Copy link

Excellent addon.... Is it possible to highlight IP addresses?

@longtth
Copy link

longtth commented Jan 12, 2018

work perfect, thanks!

@mikhailusachev
Copy link

Thanks for that!

@vcsekhar
Copy link

Thanks for sharing

@Gus7av0
Copy link

Gus7av0 commented Feb 22, 2018

Gracias!

@TeddybearCrisis
Copy link

thanks

@shabanali-faghani
Copy link

Awesome! Thank you.

@AbdhulRaheem
Copy link

how we can import this

@mmdemirbas
Copy link
Author

You can import a UDL file into Notepad++ as explained here: https://superuser.com/a/1057185/64376

@paradigmaweb
Copy link

still working! thanks!.

@chris910512
Copy link

I like this way. Super thanks.

@ishridharhegde
Copy link

Notepad++ says "Failed to Import".
Tried created a new UDL and pasting the content of this XML, it crashed the app and I lost all my unsaved notes!

Anyone else facing the similar problem?

@AlanSlaughter
Copy link

Can I add ? If so how?

@taka1945
Copy link

great job ! notepad++ x86 v7.9 still working !

@jbvazquez
Copy link

Working on 2021, for those who are wondering how to import this user-defined language here are the instructions.
Source
Import the file: Language → Define your language... → Import
Restart the application.
Language → LogFile
Now logfile should be highlighted.

@joex92
Copy link

joex92 commented Aug 17, 2021

Here I forked this and added the Dark Theme one too...

@mhewedy
Copy link

mhewedy commented Nov 17, 2022

Another install option is to copy & paste into a new file with name log.udl.xml inside : path\to\Notepad++\userDefineLangs

@TFWol
Copy link

TFWol commented Nov 23, 2022

Thanks

@nezzzumi
Copy link

Thanks!

@mmdemirbas
Copy link
Author

mmdemirbas commented Oct 18, 2023

I'm not a big open-source contributor, but it is awesome to see this still helps people after 10 years 👐

@azozaya
Copy link

azozaya commented Feb 29, 2024

Fantastic! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment