Reputation: 703
Logging in NLog can be disabled with LogManager.DisableLogging();
With PostSharp+NLog combination how do I do it?
Upvotes: 2
Views: 176
Reputation: 1408
Enabling and disabling PostSharp logging is described in detail at http://doc.postsharp.net/log-enabling.
In short, you have two options:
1) Disable logging via the PostSharp API for a specific logging role and namespace, for example
LoggingServices.DefaultBackend.GetSource(LoggingRoles.Tracing, MyCompany.BusinessLayer").SetLevel(LogLevel.Debug);
2) Use the logging back-end API.
You may need to do some set-up before using this approach as described in the doc.
However, the LogManager.DisableLogging();
of NLog is recognized by PostSharp out of the box, so you can use this one to disable the logging completely including PostSharp logging.
Upvotes: 1