E
E
e1s2015-11-15 14:25:30
C++ / C#
e1s, 2015-11-15 14:25:30

Nlog why doesn't ${basedir} work?

There is an asp.net project for logging using Nlog, installed via NuGet. In the settings I wrote

<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />

If you collect Debug, then the log is kept, but if Release or run from localhost, then the log file is not created in the specified directory.
If you hardcode the address in failName, for example, C:\my_log.log, then the log file is created in all cases.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mephistophele, 2015-11-15
@e1s

See what the EventLog, which is Windows, will write to you. Perhaps your IIS is not configured correctly, and the user does not have enough rights to write to the directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question