benbria / bunyan-debug-stream

A stream for bunyan that writes log entries as human readable output.
MIT License
30 stars 9 forks source link

Adding bunyan debug stream causes nodemon not to restart in docker? #8

Closed terencechow closed 7 years ago

terencechow commented 7 years ago

This is extremely odd and I don't understand the correlation. However I have a project that uses nodemon in development in a docker container. Changes that are done on the host are copied over to the container with docker cp. This triggers the inotify event required to trigger nodemon to restart. Everything was working fine until I added bunyan-debug-stream.

When I added bunyan debug stream, nodemon stopped restarting due to file changes. Specifically all I added was the streams array to my log:

const log = bunyan.createLogger({
  name: 'api-gateway',
  level: bunyan.DEBUG,
  src: false,
  serializers: bunyan.stdSerializers,
  // Only the streams section was added!
  streams: [{
    type:   'raw',
    stream: bunyanDebugStream({
      basepath: path.resolve(__dirname, '../'), // this should be the root folder of your project.
      forceColor: true
    })
  }]
})

So I must ask, what can bunyanDebugStream possibly be doing that prevents nodemon from restarting in a docker container? Keep in mind when I run my app locally, even with bunyanDebugStream, it restarts fine on file changes.

jwalton commented 7 years ago

O_o

I can't imagine. It's been a long time since I looked at the source to this, but I use it daily. And all this does is write colored output to stdout.

terencechow commented 7 years ago

I'll close this issue. Not sure what the issue was but I moved away from nodemon in favour of pm2 anyways

jwalton commented 7 years ago

bad-poker-face