-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Serilog logging and custom log levels
Added Serilog logging capabilities with `Serilog.Sinks.Seq` and `Serilog.AspNetCore` packages. Introduced `LoggerHelper` and custom log levels (`CustomLogLevel` and `LogLevels`). Updated command handlers and services to use the new logging helper. Modified `GetTMDBData` for async HTTP requests and integrated logging. Enhanced `Cuevana3Services` with logging for pagination and data extraction. Updated Jenkins pipeline to version `0.5.2`. Temporarily disabled authorization for `ScrapPage` endpoint. Configured Serilog in `Program.cs` to read from the application's configuration. Added new files for custom logging levels and helper.
- Loading branch information
Showing
12 changed files
with
166 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Core.Application.Helpers.Logger | ||
{ | ||
public enum CustomLogLevel | ||
{ | ||
Scraping, | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Core.Application.Helpers.Logger | ||
{ | ||
public enum LogLevels | ||
{ | ||
Information, | ||
Warning, | ||
Error, | ||
Debug, | ||
Fatal | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Core.Application.Helpers.Logger; | ||
using Serilog; | ||
|
||
namespace Core.Application.Helpers.Logs | ||
{ | ||
public static class LoggerHelper | ||
{ | ||
public static void CustomLog(CustomLogLevel customLevel, string customMessage, LogLevels level, string Value = "") | ||
{ | ||
var log = Log.ForContext("CustomLevel", customLevel.ToString()); | ||
|
||
if (!string.IsNullOrEmpty(Value)) | ||
{ | ||
log = log.ForContext("Data", Value); | ||
} | ||
|
||
switch (level) | ||
{ | ||
case LogLevels.Information: | ||
log.Information(customMessage); | ||
break; | ||
|
||
case LogLevels.Warning: | ||
log.Warning(customMessage); | ||
break; | ||
|
||
case LogLevels.Error: | ||
log.Error(customMessage); | ||
break; | ||
|
||
case LogLevels.Debug: | ||
log.Debug(customMessage); | ||
break; | ||
|
||
case LogLevels.Fatal: | ||
log.Fatal(customMessage); | ||
break; | ||
|
||
default: | ||
log.Information(customMessage); | ||
break; | ||
} | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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