Skip to content

Commit

Permalink
Merge pull request #189 from dappradar/Improve_logging
Browse files Browse the repository at this point in the history
Improve logging
  • Loading branch information
Sonmezturk committed Aug 3, 2023
2 parents e8b5ebb + a153129 commit 41099c3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 41 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/trigger-production-deployment.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/trigger-qa-deployment.yml

This file was deleted.

2 changes: 2 additions & 0 deletions src/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
HOST = '127.0.0.1',
PORT = 3002,
APP_ENV,
NODE_ENV,
SLACK_WEBHOOK_URL,
SLACK_LOGGING,
LOGSTASH_PORT,
Expand All @@ -20,6 +21,7 @@ const config = {
HOST,
PORT,
APP_ENV,
NODE_ENV,
LOGSTASH_HOST,
LOGSTASH_PORT,
LOGSTASH_INDEX,
Expand Down
4 changes: 3 additions & 1 deletion src/util/logger/appenders/logstashAppender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ interface IMessage {
interface ILogstashMessage {
'@timestamp': string;
'@metadata': { package: string };
Env: string;
Message: string;
Stack: string;
Detail: string;
Endpoint: string;
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 {
Expand All @@ -43,6 +44,7 @@ function generatePayload(loggingEvent: ILoggingEvent): ILogstashMessage {
'@metadata': {
package: LOGSTASH_INDEX,
},
Env: NODE_ENV,
Message: message,
Stack: stack,
Detail: detail,
Expand Down

0 comments on commit 41099c3

Please sign in to comment.