Skip to content

Commit

Permalink
chore(deps): Update winston-cloudwatch (#2726)
Browse files Browse the repository at this point in the history
* chore(deps): Update winston-cloudwatch

* chore(deps): Supply dummy winston cloudwatch transport name to make typescript compiler happy
  • Loading branch information
timotheeg authored Sep 7, 2021
1 parent 9be0e7e commit bb9749c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 39 deletions.
75 changes: 37 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"web-streams-polyfill": "^3.1.1",
"whatwg-fetch": "^3.6.2",
"winston": "^3.3.3",
"winston-cloudwatch": "^2.5.2",
"winston-cloudwatch": "^3.0.2",
"zod": "^3.8.2"
},
"devDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions src/app/config/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import { Environment } from '../../types'

import { aws, customCloudWatchGroup, isDev, nodeEnv } from './config'

// WINSTON_CLOUDWATCH_NAME is not actually needed, but the typescript definition has
// an error (presumably?), and so we must supply a dummy value.
// See issue: https://github.com/lazywithclass/winston-cloudwatch/issues/159
// TODO: remove if/when typescript definition is updated correctly
const WINSTON_CLOUDWATCH_NAME = 'FormSGCloudWatch'

// Params to enforce the logging format.
export type CustomLoggerParams = {
message: string
Expand Down Expand Up @@ -233,6 +239,7 @@ export const createCloudWatchLogger = (label: string) => {
if (!isDev && customCloudWatchGroup) {
loggerOptions.transports = [
new WinstonCloudWatch({
name: WINSTON_CLOUDWATCH_NAME,
logGroupName: customCloudWatchGroup,
// Every EC2 instance needs its own unique stream name, or else they
// will run into InvalidSequenceTokenException errors because they do
Expand Down

0 comments on commit bb9749c

Please sign in to comment.