Vlad Omelyanchuk
Vlad Omelyanchuk

Reputation: 3101

Logging Block to NLog

I want to use NLog instead of default Logging Block in Exception Handling Block of Enterprise Library. Anybody have any advice or working example how to do it? Thanks.

Upvotes: 0

Views: 422

Answers (2)

Randy Levy
Randy Levy

Reputation: 22655

You will need to create a custom exception handler that contains the appropriate NLog functionality. The Enterprise Library 5.0 - Extensibility Labs have samples on creating custom exception handlers.

Upvotes: 1

ddarellis
ddarellis

Reputation: 3960

You add the NLog.dll

You set a config file

You create a static logger for each class :

    private static Logger _logger = LogManager.GetCurrentClassLogger();

And then you log :

_logger.Error("error");

Upvotes: 0

Related Questions