Open Dermah opened 8 years ago
Actually I can't use the upload hook because it hasn't been pushed to npm yet :(
I get the same issue. Happens for me on both node 0.12 latest and 4 latest. Going back through commits it looks like it has always been an issue. I'd be willing to look into submitting a PR if someone can point me in the right direction.
I'm getting this issue too ... makes it impossible to use it on Lambda or similar. Always times out.
Same problem. Wanted to log lambda activity :(
I'm here for the same issue, none of these cloudwatch scripts seem to work on Lambda.
They all seem to wait for the process to exit before batching logs out to cloudwatch.
Novel idea for other types of applications.
I have found the solution to this bug. just put this line into {subscription.dispose();} the putLogEvents method after else. it's like every time a new subscriber is subscribing but it's not disposing of. after disposing of it will work accordingly
The culprit seems to be var logsSource = new Rx.Subject()
which uses a timer, and onCompleted
is never called.
- Timers:
- (5000 ~ 5 s) (anonymous) @ node_modules/rx/dist/rx.js:1431
Based on the comment from @thovden I've added
me.on("uploaded", () => {
logsSource.onCompleted();
});
at around line 40, seems to work ok? There's a PR there, but seems like @mentum has dropped this one...
Hello, is there an update for this ?
After I do
my script won't exit until I kill it manually. For example,
example.js
never exits. I'm guessing this is because of some asynchronous stuff happening usingQ
.I could use the uploaded hook to exit the process after an upload, but what if don't have anything left to log and upload?
What do you think about something like
which would upload all queued logs and sort of 'close the stream,' allowing things that use
logger
to exit naturally?