Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Castle Windsor: "LoggingFacility.UseNLog() is obsolete"

Long ago, I made a little project wherein I hoped to learn about Castle Windsor. I put it aside (before really learning all that much) for quite some time. I just opened it up again now, and updated NuGet packages, and started getting a warning CS0618:

'LoggingFacility.UseNLog()' is obsolete: 'A logger factory implementation type should be provided via LogUsing(), this will be removed in the future.'

I've googled based on this, but it's still not clear to me what I am supposed to do in order to replace the now-obsolete call, which is:

container.AddFacility<LoggingFacility>(f => f.UseNLog());

Any help would be appreciated. Thanks!

like image 833
Bob Vesterman Avatar asked Dec 18 '17 21:12

Bob Vesterman


1 Answers

Oooh, I think I have stumbled upon the answer. Haven't tested it yet, but the very least, the following does not give any compiler warning:

container.AddFacility<LoggingFacility>(f => f.LogUsing<NLogFactory>());
like image 183
Bob Vesterman Avatar answered Nov 01 '22 23:11

Bob Vesterman