❔ Serilog.Settings.Configuration file sink not writing to file?
I'm using the below configuration for Serilog trying to get it to write to both console and file, but it's only writing to console. Does anyone see what's wrong? Been looking at this for awhile now and would appreciate a second set of eyes.
JSON:
Code (Program class):
2 Replies
I quickly created a new project and tried myself. It logs to both console and file. It's worth noting that the path you have given for file is absolute path, so your log file will be generated at the root of your drive. e.g. my code is present at C:\user\source\repos\Worker1, so log file is generated at C:\logs\TestWorker.log
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.