nlog

Is NLog work with customErrors?

when i use <customErrors mode="Off"/> and i have an error on the screen it writes to log file but when i use <customErrors mode="RemoteOnly"/> then i see my custom error page but error not catches but logger :-/ ...

Logging and WCF

I have seen many other questions on logging. Best practices. What logging platform is best. Etc. Here are some links from here on SO with very good discussions on the topic: logging best practices log4net vs TraceSource best logging solution for .NET 3.5 project .NET 3.5 logging BEGIN EDIT: Having typed this long post, I guess t...

What is the best way of using NLog with MEF?

Hello, I am wondering what is the best way to use NLog with Managed Extensibility Framework (MEF)? I have an application that support plugins using MEF architecture (Import and Exports etc) I want to add logging capability to my application. As a logging component I want to use NLog. What would you recommend? 1. Create a wrapper for N...

How can I use NLog's RichTextBox Target in WPF application?

How can I use RichTextBox Target in WPF application? I don't want to have a separate window with log, I want all log messages to be outputted in richTextBox located in WPF dialog. I've tried to use WindowsFormsHost with RichTextBox box inside but that does not worked for me: NLog opened separate Windows Form anyway. ...

automated code review to check if nlog logging is taking place

i have a application written in c#.for the purpose of logging we are using nlog. while performing the code review it was found that people were not logging the required debug and info statements in each method call. What i would like to do is write a small program that will iterate through the assembely and for a particular namespace ...

NLog time formatting

Hi all! Maybe my question is obvious, but I can't find answer in NLog documentation. How to write a layout for NLog that outputs time with milliseconds like this 11:32:08:1234? Now I use ${date:format=yyyy-MM-dd HH\:mm\:ss} but I need more time precision in my logs. Thanks! ...

What is the difference between log4net.ThreadContext and log4net.LogicalThreadContext?

log4net provides two different "thread context" objects: ThreadContext and LogicalThreadContext, each of which has a property bag, Properties. ThreadContext has a ThreadContextProperties bag while LogicalThreadContext has a LogicalThreadContextProperties bag. ThreadContext is perhaps more commonly known as "MDC". LogicalContext is per...

Custom NLog LogLevels or multiple loggers per class?

Ok, here's what I really want to accomplish: I'd like to separate my 'normal' logging/auditing from my security logging/auditing. Kinda similar to how the Windows Event Logs split Application Events from Security Events. If I could create a custom LogLevel, e.g. LogLevel.AuditSuccess or LogLevel.AuditFailure, then I could set my config ...

NLog performance

What should the expected overhead be for logging? I have tried this example private class Person { private static Logger logger = LogManager.GetCurrentClassLogger(); public string Name { get; private set; } public Person(string name) { Name = name; l...

Logging custom classes through WebService using NLog.

Problem is as follows: On log event I want to send my custom object (lets say LogMessage that wraps in some way logging event) to my web service. Could work like appenders in log4net, or is there this kind of thing in Nlog btw? Or how do I do this NLog way? Note: I'm using WebService target wrapper (if this helps in any way). ...

NLog not Logging in Simple App

Hi, I am trying to implement a simple log using Nlog 1.0, using the following code Dim _logger = LogManager.GetCurrentClassLogger() _logger.Debug("Iain") And the following NLog.config. <?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-in...

NHibernate with NLog or Log4Net or something else?

I want to use NHibernate in my project, and it comes with log4net by default. In my opinion, it would be a wiser choice to go for Nlog as it still gets updates, log4net on the other hand is completely outdated. Is there a best choice because I don't really believe in using outdated technologies in my application. On the other hand, it'...

Problem matching specific NLog logger name

I have two rules configured in NLog.config: <logger name="Model" level="Info" writeTo="modelLog" final="true" /> <logger name="*" minlevel="Debug" writeTo="logFile" /> I am trying to write to the first one, using the following code: LogEventInfo eventInfo = new LogEventInfo(); eventInfo.Level = LogLevel.Info; eventInfo.LoggerName = "...

Custom log4net property PatternLayoutConverter (with index)

Is it possible to create a log4net custom PatternLayoutConverter that allows an "index" value to be configured? I know about the "property" conversion string that allows you to write code like this: ThreadContext.Properties["ID"] = yourID; And specify like this: %property{ID} That the value should be included in the output. What...

Assembly from GAC is not listed in Monodevelop's Edit References dialog

I am trying to port a small console application from Windows/.NET to Ubuntu/Mono. I have problems to add a reference to the mono version of NLog, which I added to the GAC. Adding NLog.dll to the assembly was confirmed: Installed NLog.dll into the gac (/usr/lib/mono/gac) I also find it in the GAC under: /usr/lib/mono/gac/NLog/2.0.0.0__5...

Is there a way to redirect output to external console from NLOG in asp.net app?

I just started using NLog in my asp.net application, and I need to see log messages in real time. When I run it in VS2010 I can look at VS output window, but when I run it on the test box I obviously don't have that option. What I need is when my asp.net app starts a console window should open and show log entries in real time. Any ide...

Logging with NLog into an Isolated Storage

Hi, I use the NLog Libary (http://nlog-project.org/) within my C# Win Forms to do the logging. Has anyone some experiance if it's possible to write the Logfile into an "IsolatedStorage" with this NLogger? Thx 4 answers ...

NLog not writing to the EventLog

I'm using NLog to record my logging, everything is working fine, but now I have installed the application on to a WebService in IIS 6, it is not logging to the EventLog, all other logs are working okay. What do I need to configure to get this working on the Server? ...

Causes of WARNING **: _wapi_handle_unref: Attempting to unref unused handle

When I run my app under Mono I keep getting a ton of these "warnings". Is there any way to find a root cause of this? I noticed that they start appearing after I write something to NLog (v. 1.0.0.1846), and, eventually, NLog seems to stop logging things altogether. Have you experienced same thing? It is running under Mono 2.6.7 and Ubu...