in app.config, nlog is configed like this, but when logexpert is running i can't find logexpert.log: <configSections> <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/> </configSections> <System.Windows.Forms.ApplicationConfigurationSection> <add key="DpiAwareness" value="PerMonitorV2" /> </System.Windows.Forms.ApplicationConfigurationSection> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd" autoReload="true" throwExceptions="false" throwConfigExceptions="false" internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log"> <targets> <target name="logfile" xsi:type="File" fileName="${specialfolder:folder=ApplicationData}\logs\logexpert.log" layout="${longdate}|${level:uppercase=true}|${logger}|${message}${exception:innerFormat=Type,ToString:${newline}maxInnerExceptionLevel=10:innerExceptionSeparator=-----------------------:format=Message,Type,ToString}" encoding="utf-8" archiveEvery="Day" archiveFileName="${specialfolder:folder=ApplicationData}\LogExpert\logs\Archiv\logexpert{#}.log" archiveDateFormat="yyyyMMdd" maxArchiveFiles="5" createDirs="true"/> </targets> <rules> <logger name="Program" minlevel="Info" writeTo="logfile"/> <logger name="*" minlevel="Warn" writeTo="logfile"/> </rules> </nlog>
Activity
[-]how is nlog be uesd ?[/-][+]how is nlog uesd ?[/+]Hirogen commentedon Jul 3, 2025
it's used for logging certain debug events, not for common stuff
normally it's saved in the appdata (ApplicationData) https://learn.microsoft.com/en-us/dotnet/api/system.environment.specialfolder?view=net-9.0