Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NLog:: adding source code line number to the log

Tags:

nlog

I need source code line number to the log entry through NLog.

Please let me know alternate ways to do it.

<<Log entry>> Line 23 
 <<Log entry>> Line 391

P.S. - 23, 391 are the source code line numbers. Thanks

like image 984
CuriousBenjamin Avatar asked Feb 22 '23 02:02

CuriousBenjamin


1 Answers

You may use ${callsite:fileName=true} layout renderer - indicates whether to render the source file name and line number. Documentation.

like image 76
kolbasov Avatar answered Feb 28 '23 02:02

kolbasov