Reputation: 23
I need to send an email every time the Nlog config writes into the database. Can i call a method in my controller from Nlog Config?
Upvotes: 1
Views: 581
Reputation: 26430
You can call static methods from configuration: https://github.com/NLog/NLog/wiki/MethodCall-target
You can send to an email from configuration: https://github.com/nlog/NLog/wiki/Mail-target
But since 1 is very clear about it, you need to have a static, public method which your controller isn't
Upvotes: 1