I want to implement logger (say log4net) into ASP.Net 5 and MVC 6 Web application, right now log4net doesn't supported for DNX core, therefore I want it to implement in DNX 4.5 (full .net framework) and later on switch into DNX core when log4net is available for DNX core. Does it feasible ? or is there any other option to implement logger which have file and database logging and should also has DNX 5.0 core support.
1 Answer
You should try Serilog framework. It uses semantic logging and have many adapters (sinks). It also got pre-release version with dnxCore support
5 Comments
Amol D
But Serilog does not has sink for database, I need both file and database to store logs.
Amol D
I saw that and found Serilog has sql server support but it only for full framework which dnx 4.5 not for DNX Core. If you know about this plz let me know.. Thanks
TGN12
You are right currently you can use it with seq. Have a look at stackoverflow.com/q/34379650/2483016
Nicholas Blumhardt
Sinks are also very (very!) easy to write - using
WriteTo.Sink() and an implementation of ILogEventSink might be a workaround while SQL Server support is ported to *Core.