nlog Questions
3
Solved
We are using NLog to send email messages whenever a 'serious' error occurs. It might be happening very often in some cases generating too many messages.
Is there a way to make NLog limit the numbe...
4
Solved
I need database connection string in two places in appsettings.json.
Is it possible to introduce common variable or json-path related references into json file to avoid potencial problems?
It wo...
Ericaericaceous asked 16/10, 2019 at 12:34
15
Solved
I am trying to add logging to an application running on mobile device with Windows Mobile 6.1. � .NET Compact framework 3.5. using NLog.
I have the appropriate version of the NLog distribution ins...
Photoneutron asked 11/5, 2012 at 11:50
2
Solved
I wanted to write custom target in NLog using this:
https://github.com/nlog/nlog/wiki/How%20to%20write%20a%20Target
and write my logs to MongoDB, so my code looks like this:
namespace NLog.Mongo
...
4
Solved
Just for the case that somebody produces one day the same error.
In the starting section of the NLog.config file Visual Studio tells me (with a warning) that it cannot find the NLog.xsd File
<...
2
Solved
I have an NLog database target that looks like this:
<target xsi:type="Database" name="database"
connectionString="Server=.\SQLEXPRESS;Database=ApplicationOne;Trusted_Connection=True;MultipleA...
Testudo asked 30/12, 2018 at 11:55
3
I'm working on setting up some logging in our ASP.NET Core 3 application, using ILogger (Microsoft.Extensions.Logging) with NLog to enable writing to text files.
The problem is, that the ILogger d...
Whitelivered asked 26/5, 2020 at 8:3
3
Solved
I've got a .NET Core web app that I'm trying to add logging to via NLog.
In previous projects, I've just used something like the following at the top of every class:
private static Logger logger = ...
Coccus asked 8/1, 2017 at 15:20
3
Solved
How can I avoid windows-complaining about missing descriptions for event ids when logging using NLog. When I use:
<target xsi:type="EventLog"
name="eventLog"
layout="${message}"
machineNa...
Misreckon asked 11/8, 2013 at 17:46
4
Solved
I've configured a file target for NLog as follows:
<targets>
<target name="asyncFile" xsi:type="AsyncWrapper">
<target xsi:type="File" name="logfile" fileName="${basedir}/Logs/${s...
4
Solved
I'm using NLog for logging, I use a wrapper to call log methods, my problem is: if I try to print information about the call site (${callsite}), it prints the wrapper method and not the original me...
6
EDIT 4: "From" seems to be a reserved word in NLog. Changing it "FromID" worked. this is an awesome way to pass variables to NLog and still keep your code clean !!!! THANK MIKE!!!
EDIT 3. I really...
4
Solved
.net MAUI recently removed logging in one of it's newest release. What is the alternative now and how should it be implemented? Have been going all over online, but couldn't find a single example o...
2
Solved
can any one provide me of a very sample custom layoutrenderer for nlog ?
I want to make indentation while im logging , by example
if im calling Method B from Method C
the Text log file goes li...
3
I am trying to figure out why NLog logs my error twice.
here is my config file:
<nlog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="debug" xsi:ty...
Devolution asked 9/11, 2015 at 16:44
1
Solved
I'm surprised I haven't been able to find an answer to this, but how do I get NLog to write JSON formatted messages in a pretty format, instead of the default one-line version?
Is there a simple s...
Halide asked 18/11, 2018 at 13:21
2
Solved
I am using NLog as logging provider in my solution, but some projects have migrated to Microsoft.Extensions.Logging. We're still evaluating if migrating also the rest of the code to this, but in th...
Clarkia asked 18/5, 2022 at 7:56
3
Solved
NLog allows me to use SplitGroup to log my messages to several targets. I'd like to use this feature to log each message to a common, user-specific and date-specific logs at once:
<variable nam...
Purvis asked 2/3, 2011 at 18:20
5
How can I output log as console.write() i.e. no newline with NLog?
${message} defaults to inserting a newline.
2
Solved
I'm using NLog.Extensions.Logging.
When registering a logger factory using the method AddNLog(), it is possible to enable logging scope using NLogProviderOptions.IncludeScopes.
But how to make ...
Lindbom asked 20/2, 2020 at 17:42
6
Solved
I use NLog with next configuration:
<targets>
<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
...
2
Solved
I would like to define 2 targets (typically file target on Devops and UDP locally) in nlog and choose them dynamically based on location. Motivation for this is to use different targets when runnin...
2
Solved
When logging from a derived class, should I inherit the class-logger instance from the base class, or instantiate a new one? Namely, which is better:
public class Base
{
private static Logger _lo...
1
Solved
I'm quite new at working with NLog., but I have earlier experience working with logfiles/trace files, but previously the logs looked as follows:
<timestamp> ... | main function logging
<ti...
3
Solved
Starting to use NLog. The main process (a Windows service) is writing to the log file every few seconds. I need to allow another process (a desktop app) to read this file at arbitrary times (deskto...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.