chore: Remove Telegram logging
Create and publish a Docker image / Publish image (push) Successful in 1m19s
Create and publish a Docker image / Publish image (push) Successful in 1m19s
This commit is contained in:
@@ -11,10 +11,6 @@ public static class AppConsts
|
|||||||
public const string ModeusUrlEnv = "MODEUS_URL";
|
public const string ModeusUrlEnv = "MODEUS_URL";
|
||||||
public const string ModeusDefaultUrl = "https://sfedu.modeus.org/";
|
public const string ModeusDefaultUrl = "https://sfedu.modeus.org/";
|
||||||
|
|
||||||
// Telegram
|
|
||||||
public const string TgChatIdEnv = "TG_CHAT_ID";
|
|
||||||
public const string TgTokenEnv = "TG_TOKEN";
|
|
||||||
|
|
||||||
// RateLimiter
|
// RateLimiter
|
||||||
public const string PermitLimitEnv = "PERMIT_LIMIT";
|
public const string PermitLimitEnv = "PERMIT_LIMIT";
|
||||||
public const string TimeLimitEnv = "TIME_LIMIT";
|
public const string TimeLimitEnv = "TIME_LIMIT";
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ using SfeduSchedule.Jobs;
|
|||||||
using SfeduSchedule.Logging;
|
using SfeduSchedule.Logging;
|
||||||
using SfeduSchedule.Middleware;
|
using SfeduSchedule.Middleware;
|
||||||
using SfeduSchedule.Services;
|
using SfeduSchedule.Services;
|
||||||
using X.Extensions.Logging.Telegram.Extensions;
|
|
||||||
using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;
|
using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
@@ -59,26 +58,6 @@ builder.Logging.AddConsole(options => options.FormatterName = "CustomConsoleForm
|
|||||||
.AddConsoleFormatter<ConsoleFormatter, ConsoleFormatterOptions>();
|
.AddConsoleFormatter<ConsoleFormatter, ConsoleFormatterOptions>();
|
||||||
|
|
||||||
builder.Logging.AddFilter("Quartz", LogLevel.Warning);
|
builder.Logging.AddFilter("Quartz", LogLevel.Warning);
|
||||||
if (!string.IsNullOrEmpty(configuration[AppConsts.TgChatIdEnv]) && !string.IsNullOrEmpty(configuration[AppConsts.TgTokenEnv]))
|
|
||||||
builder.Logging.AddTelegram(options =>
|
|
||||||
{
|
|
||||||
options.FormatterConfiguration = new X.Extensions.Logging.Telegram.Base.Configuration.FormatterConfiguration
|
|
||||||
{
|
|
||||||
IncludeException = true,
|
|
||||||
IncludeProperties = true,
|
|
||||||
};
|
|
||||||
options.ChatId = configuration[AppConsts.TgChatIdEnv]!;
|
|
||||||
options.AccessToken = configuration[AppConsts.TgTokenEnv]!;
|
|
||||||
options.FormatterConfiguration.UseEmoji = true;
|
|
||||||
options.FormatterConfiguration.ReadableApplicationName = "Modeus Schedule Proxy";
|
|
||||||
options.LogLevel = new Dictionary<string, LogLevel>
|
|
||||||
{
|
|
||||||
{ "Default", LogLevel.Error },
|
|
||||||
{ "SfeduSchedule.Jobs.UpdateJwtJob", LogLevel.Information },
|
|
||||||
{ "Program", LogLevel.Information },
|
|
||||||
{ "Quartz", LogLevel.Warning }
|
|
||||||
};
|
|
||||||
});
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
builder.WebHost.UseSentry(options =>
|
builder.WebHost.UseSentry(options =>
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
<PackageReference Include="Sentry.AspNetCore" Version="6.1.0"/>
|
<PackageReference Include="Sentry.AspNetCore" Version="6.1.0"/>
|
||||||
<PackageReference Include="Sentry.Profiling" Version="6.1.0"/>
|
<PackageReference Include="Sentry.Profiling" Version="6.1.0"/>
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.6"/>
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.6"/>
|
||||||
<PackageReference Include="X.Extensions.Logging.Telegram" Version="2.0.2"/>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user