I'd like to log usernames/dates of people coming in and out a let's chat server instance. I was told bunyan and winston are good candidates but I have no clue on how to implement them on this specific project.
I'm not sure on which file I have to instantiate them and how to catch username when login and when logout. My bet is in controllers/account.js but it's clearly out of my knowledge.
As a result I'd really like to obtain a rotated file with :
20171104-15:10:14 - LOGIN username with IP x
[...]
20171104-19:23:15 - LOGOUT username
Got something I'm happy with :
Thanks to @VtoCorleone for his indications
Since there are certainly better ways to achieve this, I welcome other ideas.