Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting isBulk to true, causes "Error: Callback was already called." #13

Closed
sloops77 opened this issue Feb 26, 2017 · 59 comments
Closed

Setting isBulk to true, causes "Error: Callback was already called." #13

sloops77 opened this issue Feb 26, 2017 · 59 comments
Assignees

Comments

@sloops77
Copy link

@sloops77 sloops77 commented Feb 26, 2017

we get this issue once we switched bulk delivery on.

  • AWS Linux
  • node 6 LTS
  • winston 2.2.0
  • NODE_ENV="staging"
    here is the stack trace
Error: Callback was already called.
at <unknown> (/usr/src/app/node_modules/winston/node_modules/async/lib/async.js line 38 col 31)
if (called) throw new Error("Callback was already called.");
at <unknown> (/usr/src/app/node_modules/winston/lib/winston/logger.js line 236 col 7) next();
at logged (/usr/src/app/node_modules/winston-loggly-bulk/lib/winston-loggly.js line 113 col 5) callback(null, true);
at <unknown> (/usr/src/app/node_modules/node-loggly-bulk/lib/loggly/client.js line 179 col 9) callback(new Error('Unspecified error from Loggly: ' + ex));
at Request._callback (/usr/src/app/node_modules/node-loggly-bulk/lib/loggly/common.js line 198 col 9) success(res, body);
at Request.self.callback (/usr/src/app/node_modules/node-loggly-bulk/node_modules/request/request.js line 198 col 22) self._callback.apply(self, arguments) at emitTwo (events.js line 106 col 13)
at Request.emit (events.js line 191 col 7)
at Request.<anonymous> (/usr/src/app/node_modules/node-loggly-bulk/node_modules/request/request.js line 1035 col 10) self.emit('complete', response, response.body)
at emitOne (events.js line 101 col 20)
at Request.emit (events.js line 188 col 7)
at IncomingMessage.<anonymous> (/usr/src/app/node_modules/node-loggly-bulk/node_modules/request/request.js line 962 col 12) self.emit('end', chunk)
at emitNone (events.js line 91 col 20)
at IncomingMessage.emit (events.js line 185 col 7)
at endReadableNT (_stream_readable.js line 974 col 12)
at _combinedTickCallback (internal/process/next_tick.js line 74 col 11)
at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js line 122 col 9)
@sloops77
Copy link
Author

@sloops77 sloops77 commented Feb 26, 2017

maybe related to wavded/winston-mail#33

@mostlyjason
Copy link

@mostlyjason mostlyjason commented Feb 27, 2017

Thanks for reporting!

@sloops77
Copy link
Author

@sloops77 sloops77 commented Mar 15, 2017

hey guys - any update?

@mostlyjason
Copy link

@mostlyjason mostlyjason commented Mar 15, 2017

Hey we haven't had a chance to look at this one yet. We have some other tasks ahead of this one in the queue, including #12. Hoping we can look at this next month. If you find a solution before then please share

@reharik
Copy link

@reharik reharik commented Jul 13, 2017

Sorry to me too, but me too. Really glad someone posted this cuz my stack trace is not available so I was kind of in the dark about what was causing it.

btamayo added a commit to btamayo/node-loggly-bulk that referenced this issue Aug 12, 2017
This is an example of a fix for loggly/winston-loggly-bulk#12 with a small amount of code change.

Note that these lines:
```
    if (timerFunction === null) {
      timerFunction = setInterval(function () {
        sendBulkLogs();
      },30000);
    }
```

produce the same bug when `isBulk` is `true`. See loggly/winston-loggly-bulk#13
@mostlyjason
Copy link

@mostlyjason mostlyjason commented Sep 22, 2017

We just released version 2.0.1 which we believe contains a fix for this. Please reopen if it happens again after updating.

@ianaya89
Copy link

@ianaya89 ianaya89 commented Dec 13, 2017

Hey, I am having the same issue with the version 2.0.1.

  • Heroku
  • node 8 LTS
  • winston 2.1.1

Stack Trace:

2017-12-13T18:55:19.838077+00:00 app[web.1]: Error Code- 504 "Gateway Time-out"
2017-12-13T18:55:19.875543+00:00 app[web.1]: 2017-12-13T18:55:19.874Z - error: uncaughtException: Callback was already called. date=Wed Dec 13 2017 18:55:19 GMT+0000 (UTC), pid=20, uid=5548, gid=5548, cwd=/app, execPath=/app/.heroku/node/bin/node, version=v8.9.3, argv=[/app/.heroku/node/bin/node, /app/bin/lkm-api], rss=66162688, heapTotal=39178240, heapUsed=31654440, external=18388932, loadavg=[4.5546875, 5.01171875, 5.40673828125], uptime=133822
2017-12-13T18:55:19.875545+00:00 app[web.1]: Error: Callback was already called.
2017-12-13T18:55:19.875547+00:00 app[web.1]:     at /app/node_modules/winston/node_modules/async/lib/async.js:38:31
2017-12-13T18:55:19.875548+00:00 app[web.1]:     at /app/node_modules/winston/lib/winston/logger.js:238:16
2017-12-13T18:55:19.875549+00:00 app[web.1]:     at logged (/app/node_modules/winston-loggly-bulk/lib/winston-loggly.js:129:5)
2017-12-13T18:55:19.875549+00:00 app[web.1]:     at /app/node_modules/node-loggly-bulk/lib/loggly/client.js:199:9
2017-12-13T18:55:19.875550+00:00 app[web.1]:     at Request._callback (/app/node_modules/node-loggly-bulk/lib/loggly/common.js:189:9)
2017-12-13T18:55:19.875551+00:00 app[web.1]:     at Request.self.callback (/app/node_modules/request/request.js:186:22)
2017-12-13T18:55:19.875551+00:00 app[web.1]:     at emitTwo (events.js:126:13)
2017-12-13T18:55:19.875552+00:00 app[web.1]:     at Request.emit (events.js:214:7)
2017-12-13T18:55:19.875552+00:00 app[web.1]:     at Request.<anonymous> (/app/node_modules/request/request.js:1163:10)
2017-12-13T18:55:19.875553+00:00 app[web.1]:     at emitOne (events.js:116:13)
2017-12-13T18:55:19.875553+00:00 app[web.1]:     at Request.emit (events.js:211:7)
2017-12-13T18:55:19.875554+00:00 app[web.1]:     at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:1085:12)
2017-12-13T18:55:19.875555+00:00 app[web.1]:     at Object.onceWrapper (events.js:313:30)
2017-12-13T18:55:19.875555+00:00 app[web.1]:     at emitNone (events.js:111:20)
2017-12-13T18:55:19.875556+00:00 app[web.1]:     at IncomingMessage.emit (events.js:208:7)
2017-12-13T18:55:19.875556+00:00 app[web.1]:     at endReadableNT (_stream_readable.js:1056:12)
2017-12-13T18:55:19.875557+00:00 app[web.1]:     at _combinedTickCallback (internal/process/next_tick.js:138:11)
2017-12-13T18:55:19.875557+00:00 app[web.1]:     at process._tickDomainCallback (internal/process/next_tick.js:218:9)
2017-12-13T18:55:19.912412+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-12-13T18:55:19.912822+00:00 app[web.1]: npm ERR! errno 1
2017-12-13T18:55:19.914500+00:00 app[web.1]: npm ERR! lkm-api@1.0.0 start: `./bin/lkm-api`
2017-12-13T18:55:19.914664+00:00 app[web.1]: npm ERR! Exit status 1
2017-12-13T18:55:19.914908+00:00 app[web.1]: npm ERR!
2017-12-13T18:55:19.927219+00:00 app[web.1]: npm ERR! Failed at the lkm-api@1.0.0 start script.
2017-12-13T18:55:19.940964+00:00 app[web.1]:
2017-12-13T18:55:19.927411+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2017-12-13T18:55:19.941165+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2017-12-13T18:55:19.941315+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2017-12-13T18_55_19_929Z-debug.log

Thanks!

@mostlyjason
Copy link

@mostlyjason mostlyjason commented Dec 13, 2017

@ianaya89 thanks for reporting this we'll have someone take a look at it. In the meantime, can you tell us which version of node-loggly-bulk you are using?

@mostlyjason mostlyjason reopened this Dec 13, 2017
@jfitzpatrick13
Copy link

@jfitzpatrick13 jfitzpatrick13 commented Dec 14, 2017

Same issue as ianaya89
"winston": "2.4.0",
"winston-loggly-bulk": "2.0.1"

Error Code- 504 "Gateway Time-out"

        if (called) throw new Error("Callback was already called.");
                    ^

Error: Callback was already called.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! XXX_api@1.0.0 start: node dist/app.js
npm ERR! Exit status 1

@ianaya89
Copy link

@ianaya89 ianaya89 commented Dec 14, 2017

@mostlyjason Thanks for your reply. The version seems to be 2.0.1. But just to be clear, I am not using it directly, is a dependency of winston-loggly-bulk.

@Shwetajain148
Copy link

@Shwetajain148 Shwetajain148 commented Dec 15, 2017

Hi @ianaya89 and @jfitzpatrick13, Can you please confirm if you are using version 2.2.1 of node-loggly-bulk which is latest one. Also, please let me know the node and npm version that you are running.

Thank you.

cc: @mostlyjason

@jfitzpatrick13
Copy link

@jfitzpatrick13 jfitzpatrick13 commented Dec 15, 2017

@Shwetajain148,
Yes, the main package that I'm using is winston-loggly-bulk 2.0.1
It brings in
node-loggly-bulk 2.2.1
winston 2.4.0

My setup is
node 6.10.1
npm 3.10.10

Thanks

@rushisan
Copy link

@rushisan rushisan commented Dec 19, 2017

The same problem problem
Error: Callback was already called.
at /app/node_modules/winston/node_modules/async/lib/async.js:38:31
at /app/node_modules/winston/lib/winston/logger.js:238:16
at logged (/app/node_modules/winston-loggly-bulk/lib/winston-loggly.js:129:5)
at /app/node_modules/node-loggly-bulk/lib/loggly/client.js:199:9
at Request._callback (/app/node_modules/node-loggly-bulk/lib/loggly/common.js:189:9)
at Request.self.callback (/app/node_modules/request/request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request. (/app/node_modules/request/request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage. (/app/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1056:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)

I am using
winston 2.4.0
winston-loggly-bulk 2.0.1

Ubuntu 16.04
Node 8.9.1

Looks like it happens when loggly servers returns an error, or some network problems.

@ianaya89
Copy link

@ianaya89 ianaya89 commented Dec 19, 2017

Hi @Shwetajain148, I am using:

  • node: 8.9.1
  • npm: 5.6.0
  • node-loggly-bulk: 2.0.1
@alimvedats
Copy link

@alimvedats alimvedats commented Dec 20, 2017

Same issue
node: 9.3.0
npm: 5.6.0
node-loggly-bulk: 2.0.1

@alexeyts
Copy link

@alexeyts alexeyts commented Jan 3, 2018

Same issue here:
node: 8.9.0
node-loggly-bulk: 2.0.1

@blyork
Copy link

@blyork blyork commented Jan 5, 2018

Same issue also:
node: 8.4.0
npm: 5.3.0

`-- winston-loggly-bulk@2.0.1
  +-- node-loggly-bulk@2.2.1
  | +-- json-stringify-safe@5.0.1 deduped
  | +-- moment@2.19.4
  | `-- request@2.81.0 deduped
  `-- winston@2.4.0 deduped
@magland
Copy link

@magland magland commented Jan 5, 2018

Same issue. Using winston-loggly-bulk

@amrshakya
Copy link

@amrshakya amrshakya commented Jan 6, 2018

Same issue. Using winston-loggly-bulk.

@matteo-harpoon
Copy link

@matteo-harpoon matteo-harpoon commented Jan 8, 2018

Same issue. Using winston-loggly-bulk.
node: 7.9.0
npm: 5.0.3

winston: ^2.3.1
winston-loggly-bulk: ^2.0.1

backtrace:

node_modules/winston/node_modules/async/lib/async.js:38
node_modules/winston/lib/winston/logger.js:238
node_modules/winston-loggly-bulk/lib/winston-loggly.js:129 in logged
node_modules/node-loggly-bulk/lib/loggly/client.js:199
node_modules/node-loggly-bulk/lib/loggly/common.js:189 in Request._callback
node_modules/request/request.js:186 in Request.self.callback
events.js:106 in emitTwo
events.js:194 in Request.emit
node_modules/request/request.js:1163
events.js:96 in emitOne
events.js:191 in Request.emit
node_modules/request/request.js:1085
events.js:293 in Object.onceWrapper
events.js:91 in emitNone
events.js:188 in IncomingMessage.emit
_stream_readable.js:975 in endReadableNT
internal/process/next_tick.js:80 in _combinedTickCallback
internal/process/next_tick.js:128 in process._tickDomainCallback
@blyork
Copy link

@blyork blyork commented Jan 8, 2018

I traced this issue down to loggly/node-loggly-bulk#31.

node-loggly-bulk's log function is calling its callback twice when the Loggly servers return a bad status code and then a success on a retry. This is causing a call to a async.forEach in winston.log to throw a error when transportLog calls next twice.

I am working on a fix.

@mostlyjason
Copy link

@mostlyjason mostlyjason commented Jan 8, 2018

Awesome thanks @blyork! This has been hard to nail down. I look forward to the fix you mentioned.

CC @Shwetajain148

@dguillamot
Copy link

@dguillamot dguillamot commented Jan 10, 2018

We are also running into this. Looking forward to an updated npm release with a fix! Thanks!

@rushisan
Copy link

@rushisan rushisan commented Jan 11, 2018

any update on this issue? we are getting this problem every day several times, and it restarts our application, very annoying.

@hodonsky
Copy link

@hodonsky hodonsky commented Jan 25, 2018

So close.... bump can we please give this PR a look?!

@xolubi
Copy link

@xolubi xolubi commented Feb 2, 2018

Can't wait for this to get merged!

@wlindley
Copy link

@wlindley wlindley commented Feb 15, 2018

We really need this one, too!

@magland
Copy link

@magland magland commented Feb 15, 2018

I am waiting patiently, but cannot use loggly until this is fixed.

@Samstiles
Copy link

@Samstiles Samstiles commented Feb 15, 2018

cc @mostlyjason

@dmr-loggly
Copy link

@dmr-loggly dmr-loggly commented Feb 15, 2018

Hey everyone, we apologize for the delay in responding to this issue. I'm working right now on making sure it's brought to the right people's attention to be fixed ASAP.

@dmr-loggly dmr-loggly self-assigned this Feb 15, 2018
@Shwetajain148
Copy link

@Shwetajain148 Shwetajain148 commented Feb 21, 2018

Hey everyone, Greetings! I have published a beta package version 2.0.4 of winston-loggly-bulk which contains the fix for this callback error and also improves the retry mechanism of the library on different errors.

Feel free to test the below beta package in your environment and let me know your feedback. I will release the package in production when you guys will confirm that everything works fine.

Install beta package using the below command:

npm install winston-loggly-bulk@beta

This beta package internally install node-loggly-bulk's beta package version 2.2.2.

cc: @mchaudhary

@hodonsky
Copy link

@hodonsky hodonsky commented Feb 21, 2018

I will let you know how it goes. Thank you all!

@Shwetajain148
Copy link

@Shwetajain148 Shwetajain148 commented Mar 8, 2018

Hi @ianaya89 @jfitzpatrick13 @rushisan @alimvedats @alexeyts @blyork @magland @amrshakya @matteo-harpoon @dguillamot @Samstiles @relicmelex @xolubi..

Did you guys get some time to test the above beta package that I published which contains the fix for the callback error?

I want to listen from you so that I can go ahead and release the fix in production.

Comment Ref- #13 (comment)

@hodonsky
Copy link

@hodonsky hodonsky commented Mar 8, 2018

Unfortunately I haven't had any slew of errors to trigger what would have been the bug. I'm doing some testing soon and will let you know if there are any negative effects. If you don't hear back from me in 10 days, assume all is well and it didn't get triggered, and I just forgot to come back here and tell you.

@alexeyts
Copy link

@alexeyts alexeyts commented Mar 8, 2018

As this issue constantly happened in our production system and we did not succeed fixing it in a reasonable timeframe, we abandoned the use of this library.
We instead use syslog to report the logs.

@Samstiles
Copy link

@Samstiles Samstiles commented Mar 8, 2018

Unfortunately we're in the same boat as @alexeyts :( We had no other choice and don't have the bandwidth now to swap back

@davidknoll
Copy link

@davidknoll davidknoll commented Mar 8, 2018

@magland
Copy link

@magland magland commented Mar 9, 2018

I plan to test it soon and will let you know. Thx for the fix

@Shwetajain148
Copy link

@Shwetajain148 Shwetajain148 commented Mar 15, 2018

Hi everyone! I have released the node-loggly-bulk's package version 2.2.2 which contains the fix for the callback error and also improves the error retry mechanism of the library. You can see the instructions here: https://www.loggly.com/docs/node-js-logs/ to setup nodejs logging and by running the command below-

npm install winston-loggly-bulk

Thanks!

@duhseekoh
Copy link

@duhseekoh duhseekoh commented Mar 15, 2018

Giving this a go. FYI, if you're using yarn, you'll need to remove then add winston-loggly-bulk, otherwise yarn ain't gonna update the transitive node-loggly-bulk dep.

@hodonsky
Copy link

@hodonsky hodonsky commented Mar 16, 2018

@Shwetajain148 this action rolled me back to winston-loggly-bulk@2.0.2 when the fix was in 2.0.4-beta. Is this intentional because the update is in a dependency instead?

@duhseekoh
Copy link

@duhseekoh duhseekoh commented Mar 16, 2018

@relicmelex 2.0.2 is correct for winston-loggly-bulk. @Shwetajain148 made the fix in node-loggly-bulk which is a dependency of winston-loggly-bulk. So nothing in winston-loggly-bulk changes...

@rushisan
Copy link

@rushisan rushisan commented Mar 21, 2018

Looks like node-loggly-bulk v2.2.2 did the trick. No errors for last 30 hours.

@DJphilomath
Copy link

@DJphilomath DJphilomath commented Mar 21, 2018

I've also encountered this error. I'm still in my trial period and was not so happy that the library crashed my server. I'll see if this does the trick.

@davidknoll
Copy link

@davidknoll davidknoll commented Mar 21, 2018

I can confirm the new version fixed it for me- since my last comment I've had several more instances in my logs of intermittent trouble connecting to Loggly and it's no longer crashing the app.

@Shwetajain148
Copy link

@Shwetajain148 Shwetajain148 commented Mar 28, 2018

Hi everyone, since this issue has been handled in node-loggly-bulk's 2.2.2 release, I am going ahead and closing this one.

Thanks!

@jcasner
Copy link

@jcasner jcasner commented Apr 6, 2018

We upgraded to node-loggly-bulk@2.2.2 2 days ago and are now seeing even worse problems. We are seeing more frequent 502, 504, ETIMEDOUT, and ECONNRESET errors. While the retry logic seems to be firing, we're also noticing that the retried message doesn't appear in our Loggly logs, only the messages from node-loggly-bulk about retrying.

2018-04-06 09:15:41.522
{ json: { level: "info", message: "<SOURCE IP> - [06/Apr/2018:16:15:41 +0000] "GET / HTTP/1.1" 200 5223 "-" "SiteUptime" ", timestamp: "2018-04-06T16:15:41.522Z" }, http: { clientHost: "<HOST IP>", contentType: "application/json" } }
2018-04-06 09:15:00.948
{ json: { level: "info", message: "log #22 sent successfully after 3 retries", timestamp: "2018-04-06T16:15:00.948Z" }, http: { clientHost: "<HOST IP>", contentType: "application/json" } }
2018-04-06 09:14:56.915
{ json: { level: "info", message: "log #22 - Trying again in 4000[ms], attempt no. 3", timestamp: "2018-04-06T16:14:56.915Z" }, http: { clientHost: "<HOST IP>", contentType: "application/json" } }
2018-04-06 09:14:56.915
{ json: { level: "info", message: "log #22 - failed on error: Error: read ECONNRESET", timestamp: "2018-04-06T16:14:56.915Z" }, http: { clientHost: "<HOST IP>", contentType: "application/json" } }
2018-04-06 09:13:27.508
{ json: { level: "info", message: "<SOURCE IP> - - [06/Apr/2018:16:13:27 +0000] "GET / HTTP/1.1" 200 5223 "https://www.google.ca/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36" ", timestamp: "2018-04-06T16:13:27.508Z" }, http: { clientHost: "<HOST IP>", contentType: "application/json" } }

Or, maybe the actual message is in there, but there's no way to tie back to the Log #. Up until this upgrade, we would get the occasional Callback already fired, but now we're experiencing the system crashes that others have reported. I'm not sure this issue is resolved...

@DJphilomath
Copy link

@DJphilomath DJphilomath commented Apr 6, 2018

We have also been having a lot of connection errors after the upgrade

2018-04-06T17:07:27.635Z - Waking up ... will check
log #55 - failed on error: Error: read ECONNRESET
log #55 - Trying again in 2000[ms], attempt no. 2
2018-04-06T17:07:37.636Z - Waking up ... will check
log #55 - failed on error: Error: socket hang up
log #55 - Trying again in 4000[ms], attempt no. 3
log #59 - failed on error: Error: read ECONNRESET
log #59 - Trying again in 2000[ms], attempt no. 2
log #55 sent successfully after 3 retries
log #59 - failed on error: Error: read ECONNRESET
log #59 - Trying again in 4000[ms], attempt no. 3
2018-04-06T17:07:47.637Z - Waking up ... will check
2018-04-06T17:07:57.639Z - Waking up ... will check
@hodonsky
Copy link

@hodonsky hodonsky commented Apr 6, 2018

I've been flooding my loggly pipe with load tests, and I haven't gotten a single one, can you copy in your implementation details as the error log it appears isn't super helpful as to 'why' it's happening here? @DJphilomath Also it looks like for you it's every 10 seconds pretty on the nose, do you have a timeout somewhere or a load balancer with connection draining?

@davidknoll
Copy link

@davidknoll davidknoll commented Apr 6, 2018

@jcasner
Copy link

@jcasner jcasner commented Apr 6, 2018

I've dug a bit deeper. Seems the app isn't actually crashing, but the CPU is spiking, which is leading to autoscaling events, so the affected server gets rotated out. That was hard to diagnose because the logs aren't making it through to Loggly :/

I have filed a report with Loggly also, since it seems to be bursts of network issues. It seems like the issue is degraded network activity on their side which leads to this library getting overloaded with retries. Here are the times we've noticed degraded network performance from Loggly:

4/4/18 - 14:26 - 14:32 PST - 4694 errors
4/4/18 - 16:07 - 16:12 PST - 2648 errors 
4/4/18 - 20:24 - 20:29 PST - 19306 errors
4/6/18 - 02:05 - 02:35 PST - 34522 errors
4/6/18 - 08:40 - 08:45 PST - 4205 errors

Here's our winston setup:

import winston from 'winston';
import config from '../config';

require('winston-loggly-bulk');

const logger = new winston.Logger({
  level: config.logLevel,
  exitOnError: false,
});

module.exports.stream = {
  write: (message, encoding) => logger.info(message),
};

// Override the built-in console methods with winston hooks
switch (config.environment) {
  case 'dev-local':
    logger.add(winston.transports.Console, {
      handleExceptions: true,
      json: false,
      colorize: true,
      timestamp: true,
      prettyPrint: true,
    });
    break;
  default:
    logger.add(winston.transports.Loggly, {
      token: '<AppToken>',
      subdomain: '<subdomain>',
      tags: [`${config.environment}`],
      json: true,
      timestamp: true,
    });
    break;
}

console.log = (...args) => logger.info(...args);
console.info = (...args) => logger.info(...args);
console.warn = (...args) => logger.warn(...args);
console.error = (...args) => logger.error(...args);
console.debug = (...args) => logger.debug(...args);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.