Writing logs to files using Serilog is not working if the process doesn't have file write permissions
13:39 15 May 2018

I have an ASP .NET based application that uses Serilog for logging and I want to test it by writing my logs to files. I am using Serilog and Serilog.Sinks.File So far, the code looks like this:

_perfLogger = new LoggerConfiguration()
                .WriteTo.File("C:\\Users\\andav\\Desktop\\NewTest\\logger\\perf.txt")
                .CreateLogger();

_perfLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoToLog);

But all my files are empty or are not created and I am not getting any errors.

Am I doing something wrong?

Thank you.

asp.net logging serilog