Skip to content

Commit

Permalink
add in to api and jobs too
Browse files Browse the repository at this point in the history
  • Loading branch information
srkirkland committed Jan 19, 2024
1 parent 0f75b38 commit 3f0de83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sloth.Api/Logging/LoggingConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Serilog.Exceptions;
using Serilog.Sinks.Elasticsearch;
using Serilog.Sinks.MSSqlServer;
using StackifyLib;

namespace Sloth.Api.Logging
{
Expand Down Expand Up @@ -60,6 +61,11 @@ public static LoggerConfiguration GetConfiguration()
// add in stackify sink if the api key is valid
if (!string.IsNullOrEmpty(loggingSection.GetValue<string>("ApiKey")))
{
if (!_loggingSetup)
{
_configuration.ConfigureStackifyLogging(); // applies stackify settings
}

logConfig = logConfig.WriteTo.Stackify();
}

Expand Down
6 changes: 6 additions & 0 deletions Sloth.Jobs.Core/Logging/LoggingConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Serilog.Sinks.Elasticsearch;
using Serilog.Sinks.MSSqlServer;
using Serilog.Sinks.MSSqlServer.Sinks.MSSqlServer.Options;
using StackifyLib;

namespace Sloth.Jobs.Core.Logging
{
Expand Down Expand Up @@ -66,6 +67,11 @@ public static LoggerConfiguration GetConfiguration()
// add in stackify sink if the api key is valid
if (!string.IsNullOrEmpty(loggingSection.GetValue<string>("ApiKey")))
{
if (!_loggingSetup)
{
_configuration.ConfigureStackifyLogging(); // applies stackify settings
}

logConfig = logConfig.WriteTo.Stackify();
}

Expand Down

0 comments on commit 3f0de83

Please sign in to comment.