How to color the text logs file based on Error type in NLog

1.2k Views Asked by At

I am using Nlog library in my application to logs the files.It is logging the files in text format, but i need to color the text based on error type.

logger.Info("Info error has occured"); - blue color. logger.Error("An error has occured" +ex.message); - Red color.

But it is working fine in console application,how to set the same in text file?

 <target name="coloredConsole" xsi:type="ColoredConsole" useDefaultRowHighlightingRules="false"
    +        layout="${longdate}|${pad:padding=5:inner=${level:uppercase=true}}|${message}" >
0

There are 0 best solutions below