Skip to content

Commit

Permalink
Merge pull request DevArchitecture#109 from burakhalefoglu/Console-Lo…
Browse files Browse the repository at this point in the history
…g-Added

Console Log added
  • Loading branch information
keremvaris authored Jun 30, 2024
2 parents b889171 + e6d4467 commit b7c3ce3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions Core/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<PackageReference Include="RabbitMQ.Client" Version="6.4.0" />
<PackageReference Include="Refit" Version="6.3.2" />
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1"/>
<PackageReference Include="Serilog.Formatting.Elasticsearch" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.Http" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.MicrosoftTeams" Version="0.2.1" />
Expand Down
14 changes: 14 additions & 0 deletions Core/CrossCuttingConcerns/Logging/Serilog/Loggers/ConsoleLogger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Serilog;

namespace Core.CrossCuttingConcerns.Logging.Serilog.Loggers;

public class ConsoleLogger : LoggerServiceBase
{
public ConsoleLogger()
{
var seriLogConfig = new LoggerConfiguration()
.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}")
.CreateLogger();
Logger = seriLogConfig;
}
}

0 comments on commit b7c3ce3

Please sign in to comment.