Closed MAOShea closed 8 years ago
Hi Michael,
It looks like you are confusing two things here (as well as pointing a problem in the documentation):
logger
entry of the server configuration is used to configure a wrapper of bunyan, which is used internally to log connections and disconnections of the clients, but which is not exposed in soundworks (I'm not sure at this point if it will be).debug
package, so you do two different things which are not related: configure bunyan
to log in a file and use debug
to log your own messages.I actually don't know if debug
is able to write logs inside a file but it's anyway something you should look for in the documentation of this package.
Benjamin
Benjamin,
thanks for the prompt response.
As you will have maybe already have detected, I'm still very much a n00b in Node.js.
To complement your analysis of my failed attempt at logging, could you kindly suggest what would be the correct strategy for implementing the ability to log to a file?
If there is anything in SoundWorks that I should be building upon or should I be trying to implement my own solution (possibly with the help of other packages available in the npm ecosystem)?
Regards et merci beaucoup!
Michael
Hey,
No, there is nothing in soundworks to help you to do that, as I said the logger is not exposed for now and I'm really not sure it can be considered as something stable enough to be exposed.
To add logging in your own application, I think these 2 solutions are generally considered as good choices:
Bests, Benjamin
Thank you !
Regards,
Michael
Hi guys, I don't know if this is an issue at all or just something that could be covered in the documentation at some point. Suffice it to say that my attempts to get it to work failed.
In my server's index.js I have this (see the logger object) :
Later on, in one of my Activity classes:
I set my DEBUG environment variable to enable paisleyworks:PerfLoNormalHi.
When I run SoundWorks, I see:
What am I doing wrong?
Thanks!
Michael