1 year ago

#359250

test-img

Olga

How to add a computer environment variable to a console application as a path pointer for logging

I created a variable on the computer and specified the path to the folder through it, then specified it in the NLog.config file

fileName="${environment:LOG_DIRECTORY}${date:format=yyyy-MM-dd}_reportlog.txt"

But the file is still being deleted in the default order. I tried to write a path in my own class, but it still doesn't help. It is necessary to set the path through the environment variable.

c#

logging

console-application

nlog

0 Answers

Your Answer

Accepted video resources