Created
November 23, 2024 14:02
-
-
Save javierguerrero/fb732a70a21b245d0594b5fbd5e0bbf3 to your computer and use it in GitHub Desktop.
exception_handling_csharp_chapter7_2.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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