I am trying to use WriteTo.RollingFile with Serilog as the following:
var log = new LoggerConfiguration().WriteTo.RollingFile(
@\"F:\\log
Here is a way to use Serilog with a web.config in an asp.net MVC 4/5 app.
In your web.config add the following:
Then in Application_Start
of global.asax add the following:
// Get application base directory
string basedir = AppDomain.CurrentDomain.BaseDirectory;
// Setup Serilog for logging
Log.Logger = new LoggerConfiguration()
.ReadFrom.AppSettings()
.WriteTo.RollingFile(basedir + "/Logs/log-{Date}.txt")
.CreateLogger();