Skip to content

Custom Logging with NLog

Kyryl Krylov, CPA edited this page Apr 8, 2020 · 7 revisions

To enable custom logging update nlog.config and nlog.targets.config. Both files are located in [AppPath]\Terrasoft.WebApp

NlogFiles

Add the following to nlog.config file:

<logger name="GuidedLearningLogger" writeTo="GuidedLearningAppender" 
        minlevel="Info" final="true" />

Add the following to the nlog.target.config file

<target name="GuidedLearningAppender" xsi:type="File"
	layout="${Date} [${ThreadIdOrName}] ${uppercase:${level}} ${UserName} ${MethodName} - ${Message}"
	fileName="${LogDir}/${LogDay}/GuidedLearning.log" />

Academy Related Articles