diff --git a/Webzine.WebApplication/Areas/Administration/Controllers/ArtisteController.cs b/Webzine.WebApplication/Areas/Administration/Controllers/ArtisteController.cs index 9442b48..fd3d7f2 100644 --- a/Webzine.WebApplication/Areas/Administration/Controllers/ArtisteController.cs +++ b/Webzine.WebApplication/Areas/Administration/Controllers/ArtisteController.cs @@ -81,16 +81,8 @@ public class ArtisteController : Controller Biographie = model.Biographie, }; - try - { - this.artisteRepository.Add(artiste); - this.logger.LogInformation("Création d'un nouvel artiste: {Nom}", artiste.Nom); - } - catch (Exception ex) - { - this.logger.LogError(ex, "Erreur lors de la création de l'artiste: {Nom}", artiste.Nom); - return this.View(model); - } + this.artisteRepository.Add(artiste); + this.logger.LogInformation("Création d'un nouvel artiste: {Nom}", artiste.Nom); // Renvoyer sur la page Index. return this.RedirectToAction("Index"); diff --git a/Webzine.WebApplication/appsettings.json b/Webzine.WebApplication/appsettings.json index cc61318..a3604ad 100644 --- a/Webzine.WebApplication/appsettings.json +++ b/Webzine.WebApplication/appsettings.json @@ -2,7 +2,8 @@ "Logging": { "LogLevel": { "Default": "Information", - "Microsoft.AspNetCore": "Warning" + "Microsoft.AspNetCore": "Warning", + "Webzine.Repository": "Debug" } }, "Webzine": { diff --git a/Webzine.WebApplication/nlog.config b/Webzine.WebApplication/nlog.config index c2ba55e..2ff20bb 100644 --- a/Webzine.WebApplication/nlog.config +++ b/Webzine.WebApplication/nlog.config @@ -29,6 +29,7 @@ +