Use of NLog variables in internalLogFile setting
See original GitHub issueIs there any way I could specify a variable in the <nlog /> attributes?
I know you cannot use layout variables, but it would be wonderful to be able to write in the .config something like:
internalLogFile="c:/logs/Nlog.${processname}.log"
BTW: the issue has been mentioned in StackOverflow http://stackoverflow.com/questions/9428724/nlog-internal-log-not-working-with-asp-net-mvc
Issue Analytics
- State:
- Created 9 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Using GlobalDiagnosticsContext in NLog internalLogFile
I stepped through NLog code and it seems it only calls ExpandFilePathVariables to expand some known environment variables before setting the ...
Read more >Logging Configuration File | Documentation
The logging can be customized by providing a configuration file to NLog, e.g. by creating an "nlog.config" file in the same folder as...
Read more >NLog Tutorial - The essential guide for logging from C#
The ultimate tutorial for NLog. Learn about everything from logging and structured log messages to layout renderers and configuration of ...
Read more >Logging with NLog in ASP.NET Core
NLog uses this configuration file to load the settings. ... and also a basic SQL command to log the NLog variables to the...
Read more >Nlog - How to log certain actions into a seperate file?
Hi there, I am working on a Blazor Server application. I am using Nlog for logging. Here is my nlog configuration; <?xml version="1.0" ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
NLog ver. 4.6 add support for environment-variables like
%appdata%
or%HOME%
, and using these basic layouts ininternalLogFile=
:${currentdir}
${basedir}
${tempdir}
NLog ver. 4.7 also adds this:
${processdir}
See also: https://github.com/NLog/NLog/wiki/Internal-Logging
Yes, that’s the case. And then we should write an internal-internal-logger 😉
If there is a really great benefit to implement, we will add it as feature request.