Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save javierguerrero/fb732a70a21b245d0594b5fbd5e0bbf3 to your computer and use it in GitHub Desktop.
Save javierguerrero/fb732a70a21b245d0594b5fbd5e0bbf3 to your computer and use it in GitHub Desktop.
exception_handling_csharp_chapter7_2.cs
Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.WriteTo.File("logs/log.txt", rollingInterval: RollingInterval.Day)
.CreateLogger();
try
{
// Código que puede fallar
}
catch (Exception ex)
{
Log.Error(ex, "Error inesperado en la aplicación");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment