Hi !
I want to have one log file per day per process.
I would only like to modify in the nlog.config file.
Thus, I am trying to modify the filename of the logs file, but I didn’t succeed…
Steps I tried:
I went to C:\Program Files\UiPath\Studio
and modified the file nlog.config
I tried to add several attributes at type File in filename tag.
Like originally the file was:
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<variable name="WorkflowLoggingDirectory" value="${specialfolder:folder=LocalApplicationData}/UiPath/Logs" />
<rules>
<logger name="WorkflowLogging" writeTo="WorkflowLogFiles" final="true" />
</rules>
<targets>
<target type="File" name="WorkflowLogFiles" fileName="${WorkflowLoggingDirectory}/${shortdate}_Execution.log" layout="${time} ${level} ${message}" keepFileOpen="true" openFileCacheTimeout="5" concurrentWrites="true" encoding="utf-8" writeBom="true" />
</targets>
</nlog>
and I modified it as:
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<variable name="WorkflowLoggingDirectory" value="${specialfolder:folder=LocalApplicationData}/UiPath/Logs" />
<rules>
<logger name="WorkflowLogging" writeTo="WorkflowLogFiles" final="true" />
</rules>
<targets>
<target type="File" name="WorkflowLogFiles" fileName="${WorkflowLoggingDirectory}/${shortdate}_${processname:fullName=true}_Execution.log" layout="${time} ${level} ${message}" keepFileOpen="true" openFileCacheTimeout="5" concurrentWrites="true" encoding="utf-8" writeBom="true" />
</targets>
</nlog>
I tried to understand the documentation of https://nlog-project.org/config/?tab=layouts but couldn’t use it properly…
Does someone know how to do it ?
Thanks !