require('debug')('controllers:something')
debug('doing stuff', someObj)
then selectively enable it in the command-line with DEBUG=controllers:* node index.js
Express has debug built-in, so setting debug to express:* will turn on logging for it's internals. Just saying this 'cause I wish more tools came with built-in logging :)Long-running programs will happily continue using the same file handle until they are signaled in some way to reopen the file path (usually in response to USR1 and HUP). See Nginx, Apache httpd, MongoDB, etc.
I feel slightly disappointed (no offence op)...
OP - could you rename the library to make us all feel a little bit better about using it?