Logging using NLog.Logger

Hello Community,

I am trying to improve our logging and I have found that NLog.Logger is a really great framework,

but somehow I can't see the logs created by the scripts (VB.NET Code) called by the processes.

Is there something I am missing here?

My code from an external custom script

Dim log As NLog.Logger = LogManager.GetLogger(LogNames.JobGenLog)
log.Debug("Log entry from JobGenLog logger")

globallog.config

<nlog autoReload="true" xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<targets>
		<default-wrapper xsi:type="AsyncWrapper" batchSize="1000" overflowAction="Block" timeToSleepBetweenBatches="0" />
		<target name="jobgenlogfileTmp" xsi:type="File" fileName="C:/OneIdentity/Log/${appName}_jobgen.log" layout="${layout}" encoding="utf-8"
			archiveFileName="C:/OneIdentity/Log/${appName}_jobgen.{#}.log" maxArchiveFiles="7" archiveEvery="Day" archiveNumbering="Rolling"/>		
	</targets>

	<rules>
		<logger name="JobGenLog" minlevel="Debug" writeTo="jobgenlogfileTmp"/>
	</rules>
</nlog>

I am able to see the generated logs by the processes, but not by the VB.Net custom scripts that the process is calling.

Any hints where or what to check?

Thank you!

Parents Reply Children