Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switchable Logger #31

Closed
aintnorest opened this issue Nov 26, 2018 · 8 comments
Closed

Switchable Logger #31

aintnorest opened this issue Nov 26, 2018 · 8 comments
Assignees

Comments

@aintnorest
Copy link

Is there an easy way to switch out the logger? The application I'm porting over is using bunyan and I'd prefer to not have to redo it through out.

@weekens
Copy link
Contributor

weekens commented Nov 27, 2018

There is some work needed to be put in order to make this work, but I think it's a matter of couple of days. I was expecting this kind of request. Will try to do in nearest time.

@weekens weekens self-assigned this Nov 27, 2018
@weekens
Copy link
Contributor

weekens commented Dec 8, 2018

Added support for custom loggers in v1.8.0. See example: https://github.com/untu/comedy-examples/blob/master/custom-logger-bunyan.js

@weekens weekens closed this as completed Dec 8, 2018
@aintnorest
Copy link
Author

I used your example and it worked great until I tried starting an actor in forked mode. I then got Error: Cannot serialize actor definition. I threw a console in and noticed it was the BunyanLoggerAdapter. I made sure to move all the requires into the class itself but that didn't seem to help so I switched it to use the module method of loading. That worked but with two problems. I now get a warning for:
Promise.defer is deprecated and will be removed in a future version. Use new Promise instead.
a lot and my second problem is I'm not sure how to pass in a name for the bunyan initialization.

@weekens weekens reopened this Feb 19, 2019
@weekens
Copy link
Contributor

weekens commented Feb 19, 2019

I will look at Promise.defer warnings.

As for logger name: in the example it was hard-coded into BunyanLoggerAdapter. Clearly, this may be not what you want. My question is: how would you like this to be done instead?

@aintnorest
Copy link
Author

Maybe a way to pass in customParameters as part of the configuration.

@weekens
Copy link
Contributor

weekens commented Feb 23, 2019

@aintnorest , I've implemented constructor parameters for custom logger. Please check forked-bunyan-logger branch from comedy-examples repo together with custom-logger-params branch from this repo and tell if it works for you.

As for Promise.defer error - I could not reproduce it in forked-bunyan-logger branch in examples even with current Comedy release. Please try that example with release version and tell if you are able to see Promise.defer errors. If not, please send me your code example.

@aintnorest
Copy link
Author

looks great thanks.

@weekens weekens closed this as completed Mar 9, 2019
@weekens
Copy link
Contributor

weekens commented Mar 9, 2019

Fix released in v.2.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants