From a1531294bfa799350498c542c2a72498b25ee2eb Mon Sep 17 00:00:00 2001 From: osman sonmezturk Date: Thu, 3 Aug 2023 16:45:28 +0300 Subject: [PATCH] logging was improved and delete deprecated GA --- .../trigger-production-deployment.yml | 20 ------------------- .github/workflows/trigger-qa-deployment.yml | 20 ------------------- src/app.config.ts | 2 ++ src/util/logger/appenders/logstashAppender.ts | 4 +++- 4 files changed, 5 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/trigger-production-deployment.yml delete mode 100644 .github/workflows/trigger-qa-deployment.yml diff --git a/.github/workflows/trigger-production-deployment.yml b/.github/workflows/trigger-production-deployment.yml deleted file mode 100644 index 62161a4e..00000000 --- a/.github/workflows/trigger-production-deployment.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Trigger production deployment - -on: - push: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Send dispatch event to CICD repository - run: | - curl \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.CICD_REPO_DISPATCH_TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/${{ secrets.CICD_REPOSITORY_NAME }}/dispatches \ - --data '{"event_type": "deploy-defi-providers-prod", "client_payload":{"branch": "master"}}' diff --git a/.github/workflows/trigger-qa-deployment.yml b/.github/workflows/trigger-qa-deployment.yml deleted file mode 100644 index 1289ab2c..00000000 --- a/.github/workflows/trigger-qa-deployment.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Trigger QA deployment - -on: - push: - branches: [ staging ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Send dispatch event to CICD repository - run: | - curl \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.CICD_REPO_DISPATCH_TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/${{ secrets.CICD_REPOSITORY_NAME }}/dispatches \ - --data '{"event_type": "deploy-defi-providers-qa", "client_payload":{"branch": "staging"}}' diff --git a/src/app.config.ts b/src/app.config.ts index 2b5001d3..47b88f8e 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -7,6 +7,7 @@ const { HOST = '127.0.0.1', PORT = 3002, APP_ENV, + NODE_ENV, SLACK_WEBHOOK_URL, SLACK_LOGGING, LOGSTASH_PORT, @@ -39,6 +40,7 @@ const config = { HOST, PORT, APP_ENV, + NODE_ENV, LOGSTASH_HOST, LOGSTASH_PORT, LOGSTASH_INDEX, diff --git a/src/util/logger/appenders/logstashAppender.ts b/src/util/logger/appenders/logstashAppender.ts index bb44b592..7a4c5626 100644 --- a/src/util/logger/appenders/logstashAppender.ts +++ b/src/util/logger/appenders/logstashAppender.ts @@ -21,6 +21,7 @@ interface IMessage { interface ILogstashMessage { '@timestamp': string; '@metadata': { package: string }; + Env: string; Message: string; Stack: string; Detail: string; @@ -28,7 +29,7 @@ interface ILogstashMessage { Host: string; Level: string; } -const { LOGSTASH_HOST, LOGSTASH_PORT, LOGSTASH_INDEX } = config; +const { NODE_ENV, LOGSTASH_HOST, LOGSTASH_PORT, LOGSTASH_INDEX } = config; function generatePayload(loggingEvent: ILoggingEvent): ILogstashMessage { const { @@ -43,6 +44,7 @@ function generatePayload(loggingEvent: ILoggingEvent): ILogstashMessage { '@metadata': { package: LOGSTASH_INDEX, }, + Env: NODE_ENV, Message: message, Stack: stack, Detail: detail,