From 10bf53adec13d38721be7f1ec23ece895c063aa8 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Sun, 22 Dec 2024 07:16:54 +0300 Subject: [PATCH] feat: add integration with seq --- src/pages/setup/logging/logging.component.html | 18 ++++++++++++++++++ src/pages/setup/logging/logging.component.ts | 14 ++++++++++---- src/pages/setup/summary/summary.component.html | 10 ++++++++++ .../v1/configuration/loggingRequest.ts | 2 ++ 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/src/pages/setup/logging/logging.component.html b/src/pages/setup/logging/logging.component.html index 150c468..a1fa21c 100644 --- a/src/pages/setup/logging/logging.component.html +++ b/src/pages/setup/logging/logging.component.html @@ -4,6 +4,11 @@ Настройте систему логирования как будет удобно для отображения. Можно настроить путь к файлу, имена файлов или вовсе отключить логирование в файл.

+

+ Также вы можете настроить интеграцию с Seq. + Введите необходимые данные и мы отправим тестовый лог на сервер Seq. Его уровень будет Warning. + Если тестовый лог не появился вернитесь на данный шаг и перепроверьте данные. +

@@ -31,5 +36,18 @@ matTooltip="Укажите название файла, в который будут записаны логи" formControlName="logName"> + + + Сервер Seq + + + + Api ключ Seq + +

diff --git a/src/pages/setup/logging/logging.component.ts b/src/pages/setup/logging/logging.component.ts index 4332420..20f5f78 100644 --- a/src/pages/setup/logging/logging.component.ts +++ b/src/pages/setup/logging/logging.component.ts @@ -45,7 +45,9 @@ export class LoggingComponent { this.loggingSettings = this.formBuilder.group({ enabled: [true, Validators.required], logPath: [''], - logName: [''] + logName: [''], + seqServer: [''], + seqKey: [''] } ); @@ -56,9 +58,11 @@ export class LoggingComponent { this.navigationService.nextButtonAction = () => { return this.api.setLogging({ - "enableLogToFile": this.loggingSettings.get('enabled')?.value, - "logFileName": this.loggingSettings.get('logName')?.value, - "logFilePath": this.loggingSettings.get('logPath')?.value + enableLogToFile: this.loggingSettings.get('enabled')?.value, + logFileName: this.loggingSettings.get('logName')?.value, + logFilePath: this.loggingSettings.get('logPath')?.value, + apiServerSeq: this.loggingSettings.get('seqServer')?.value, + apiKeySeq: this.loggingSettings.get('seqKey')?.value } ); }; @@ -73,6 +77,8 @@ export class LoggingComponent { this.loggingSettings.get('enabled')?.setValue(x.enableLogToFile); this.loggingSettings.get('logName')?.setValue(x.logFileName); this.loggingSettings.get('logPath')?.setValue(x.logFilePath); + this.loggingSettings.get('seqServer')?.setValue(x.apiServerSeq); + this.loggingSettings.get('seqKey')?.setValue(x.apiKeySeq); }); } } diff --git a/src/pages/setup/summary/summary.component.html b/src/pages/setup/summary/summary.component.html index dcf0d79..6b5b0b0 100644 --- a/src/pages/setup/summary/summary.component.html +++ b/src/pages/setup/summary/summary.component.html @@ -163,6 +163,16 @@ Путь к файлу журнала: {{ loggingConfig.logFilePath }} } + @if (loggingConfig.apiServerSeq) { +
+ Сервер Seq: {{ loggingConfig.apiServerSeq }} +
+ } + @if (loggingConfig.apiKeySeq) { +
+ Ключ Seq: {{ loggingConfig.apiKeySeq }} +
+ } } diff --git a/src/shared/requests/v1/configuration/loggingRequest.ts b/src/shared/requests/v1/configuration/loggingRequest.ts index 4ce7669..63f8e18 100644 --- a/src/shared/requests/v1/configuration/loggingRequest.ts +++ b/src/shared/requests/v1/configuration/loggingRequest.ts @@ -2,4 +2,6 @@ export interface LoggingRequest { enableLogToFile: boolean; logFileName?: string; logFilePath?: string; + apiServerSeq?: string; + apiKeySeq?: string; }