I'm using NLog in a multi-project solution. I set the filename
property of the config file to "${basedir}/logs/logFile.log"
and the problem is: the logs directory is being created in each project's main directory, so each project has its own set of logs. What I'd like to have is a single log directory for the whole solution, so basically it means setting the filename
to basedir's parent directory.
How exactly can I do it? "../${basedir}/logs/logFile.log"
doesn't seem to work, the logs are still saved to the same directory.
I had a similar situation. I needed the /logs/ directory to be a sibling of the actual directory of my project. I found that this works for me with:
fileName="${basedir}/../logs/logFile.log"
I'm using NLog 2.1.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With