Nlog: Need Help.

Created on 3 Oct 2018  路  3Comments  路  Source: NLog/NLog

Hi Friends,

I am very new to Nlog, I have got assigned task to implement exception and Audit log using Nlog. Based on my knowledge i have created one static class having Error and Info static info methods,

I am using GetLogger("Name") in each methods to point particular target like eventviewer for different layout.
I am using GetLogger("Name") in each methods to point particular target like File for different layout.

is this approach is correct or any suggestions.

please reply me.

question

All 3 comments

Hi Friends,

I am very new to Nlog, I have got assigned task to implement exception and Audit log using Nlog. Based on my knowledge i have created one static class having Error and Info static info methods,

I am using GetLogger("Name") in each methods to point particular target like eventviewer for different layout.
I am using GetLogger("Name") in each methods to point particular target like File for different layout.

is this approach is correct or any suggestions.

please reply me.

Hi, first of all please use guidlines for asking and formulating questions, please update your question.

As I understand you just need output _Info_ to AuditLog and _Errors_ to ErrorLog?, If I am right, check out Rules and if it works for you, I wouldn't create new class just for two methods to pass a message, I would use NLog Fluent API.

The Wiki is a good place to start: https://github.com/NLog/NLog/wiki/Tutorial

I assume your question has been answered, if not, please let us know!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ranjan-2209 picture ranjan-2209  路  3Comments

ericnewton76 picture ericnewton76  路  3Comments

ErcinDedeoglu picture ErcinDedeoglu  路  3Comments

FaMouZx3 picture FaMouZx3  路  3Comments

Jerefeny picture Jerefeny  路  3Comments