Skip to content

Commit

Permalink
Update NLog.config
Browse files Browse the repository at this point in the history
Eventlog
  • Loading branch information
mpetereit authored Jul 21, 2023
1 parent 4315bdb commit 8fe7531
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Build/Template/site/NLog.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<extensions>
<add assembly="NLog.WindowsEventLog" />
</extensions>

<targets>

<!--
Expand All @@ -35,13 +39,22 @@
<target name="fileSummary" xsi:type="AsyncWrapper" queueLimit="5000" overflowAction="Grow">
<target xsi:type="File" fileName="c:/scripts/webjea-usage.log" layout="${longdate}|${aspnet-request-host}|${aspnet-user-identity}|${message}" />
</target>

<!-- Eventlog -->
<!--PS Command to create Eventlog: New-EventLog -LogName Application -Source "WebJEA"-->

<!-- <target name="eventlog" xsi:type="EventLog" source="WebJEA" log="WebJEA" layout="${longdate}|${level}|${counter}|${aspnet-TraceIdentifier}|${aspnet-user-identity}|${message}"/> -->
<!-- <target name="eventlog" xsi:type="EventLog" source="WebJEA" log="WebJEA" layout="${longdate}|${aspnet-request-host}|${aspnet-user-identity}|${message}"/> -->

<target name="console" xsi:type="Debugger" layout="${message}" />
</targets>

<rules>
<!--logger name="*" minlevel="Debug" writeTo="file" /-->
<logger name="*" minlevel="Trace" writeTo="console,file" />
<logger name="*" minlevel="Trace" writeTo="console,file" />
<logger name="*" maxlevel="Info" minlevel="Info" writeTo="fileSummary" />
<!-- Eventlog -->
<logger name="*" minlevel="Trace" writeTo="eventlog" />
<!-- add your logging rules here -->

<!--
Expand Down

0 comments on commit 8fe7531

Please sign in to comment.