Closed satyaram243 closed 6 months ago
Not entirely sure why your extensions is failing, but the first thing is to move the configuration of the Serilog
self logger to before the logger is created:
public static void Main(string[] args)
{
SelfLog.Enable(msg => Debug.WriteLine(msg));
// add remainder of code ....
}
By enabling the self log before the logger is created, you'll be able to see any configuration errors that may be occurring during the LoggerConfiguration
lifecycle.
p.s. please don't post images of code.
@satyaram243 What were the results of the self log?
Hi! Thanks for your message. This one would be a good fit for the serilog
tag on Stack Overflow (only minimal maintainer time available here). Closing as stale, sorry about the lack of response earlier on.
I am currently working on a .Net core 3 project. I have files and email sink setup for logging in the errors. I am able to see the errors logging in file but not getting emails. When I add a debug statement inside the custom email method, I am able to see all the app setting. I am using the following code and app settings for email sink.
{ "Name": "CustomEmail", "Args": { "ConnectionInfo": { "NetworkCredentials": { "UserName": null, "Password": null }, "FromEmail": "test@test.com", "MailServer": "test", "EmailSubject": "[{Level}] <{MachineName}> Log Email", "Port": "25", "IsBodyHtml": false, "EnableSsl": false, "ToEmail": "test@test.com" }, "RestrictedToMinimumLevel": "Error", "OutputTemplate": "{Timestamp:yyyy-MM-dd HH:mm} [{Level}] <{MachineName}> {Message}{NewLine}{Exception}" } }
![image](https://user-images.githubusercontent.com/13768145/103832837-f72f4300-5044-11eb-9da7-08671bd363e7.png)