-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BUG] Logging configuration when running bokeh server #8856
Comments
@lunarspectrum Python logging is frankly confusing to me, and not an area of expertise for me. Are there changes we could make that would be better for users wanting to change logging settings? Perhaps a flag could override the default automatic invocation of |
I'll take a swing at it after the weekend. I agree, python logging is deeply confusing! |
@lunarspectrum did you still intend to submit any PR around this? |
Oh dear...it has been a while, hasn't it? I still intend to... |
Since I've just spent half a day trying to debug application logging configuration being hijacked by some other libraries, I'd like to add my five cents. Situations where you need to call
Situations where you need to call
Situations where you need to fiddle with loggers that come from other modules (Dask distributed, I'm looking at you):
What it means for Bokeh: if Bokeh is used via its |
I'm happy to entertain any proposals for changes or updates to Bokeh logging code that satisfy one hard, fast, absolute requirement:
That is literally all I care about. I regard it as frankly irresponsible that the default Python state for deprecation warnings is that they not be visible. This just means that most users never ever see them at all, rendering them utterly useless in practice. And more importantly, it means an increased support burden on me personally, that I am not willing to tolerate. |
@bryevdv A good requirement, but it has nothing to do with logging. That is, unless a user replaces the default Python warnings handling. But in that case, all the best are off anyway. |
@p-himik AFAIK all the current bokeh logging code is in place specifically to service that goal. But I didn't write it, and its not an area of expertise for me, so I might just be wrong. I would be very happy to delete all our logging code if it's proved not actually necessary or useful.Upcoming 2.0 would be a great chance to make breaking changes. But this is a task someone else will have to drive. |
The relevant files (AFAIK) are https://github.com/bokeh/bokeh/blob/master/bokeh/__init__.py |
@bryevdv Only this code is relevant to the warnings: https://github.com/bokeh/bokeh/blob/master/bokeh/__init__.py#L84-L101. Although, I'm not that sure about the custom implementation of Default Python implementation (which is being used here, unless a user has already overridden it before that code is executed) writes directly to The optimal solution IMO would be to just use |
BTW a nice implementation reference is the Tornado's one. It customizes message format, date format, colors, rotation, and it ties it all to its CLI options. The only issue I have with it is that if you want to use Tornado's |
@p-himik and @bryevdv , the bug I submitted is simpler than all of this (I think). When you run The best code-fix I've thought of is to add a keyword option to bokeh's implementation of |
@lunarspectrum The bug is simpler only on the surface. A proper solution should not require fiddling with already configured handlers. |
In Bokeh 1.1.0, when a bokeh application is run on a bokeh server, configuration of the root logger inside the user application via
logging.basicConfig
orbokeh.utils.logconfig.basicConfig
is ignored. This is becausebasicConfig
has already been called when the bokeh server is started and has already assigned a handler to the root logger. Thelogging.basicConfig
function does nothing when a handler is already assigned, which is expected behavior. Documentation on the bokeh server page could help a user to know that to modify the root logger behavior within a program, the root logger handlers must be accessed directly.The text was updated successfully, but these errors were encountered: