enable timerotateloghandler (configurable)#311
Conversation
|
@mistercrunch I am testing this PR to enhance logging in caravel. Reference: |
| 2) https://docs.python.org/2/library/logging.config.html | ||
| """ | ||
|
|
||
| from caravel import app |
There was a problem hiding this comment.
I think that creates a circular import
|
The build failed because of what I'm guessing is a circular import. I don't think we need a specific module for just the logging config, I'd squeeze that into |
|
Cool. Looking into it. |
| from caravel import db | ||
|
|
||
| config = app.config | ||
| logging.config.dictConfig(config.get('LOGGING_CONFIG')) |
There was a problem hiding this comment.
is this line needed here and everywhere else?
It's already called in caravel/__init__.py and that is executed whenever any caravel module is imported.
There was a problem hiding this comment.
Thats a good catch. I tested it after removing the redundant declaration and it works.
| """Starts a Caravel web server""" | ||
| debug = debug or config.get("DEBUG") | ||
| if debug: | ||
| debug = config.get('LOG_LEVEL') |
There was a problem hiding this comment.
debug meant something else here (whether the web server should run in debug mode). We should keep that insulated from the logging level.
There was a problem hiding this comment.
I see. I noticed that but was wondering what if debug = True and Log Level = Debug. I have reverted back the setting for running web server as debug mode true/false
|
|
3 similar comments
|
|
|
|
|
|
|
Ok sorry about the incremental comments, I should have written all comments at once early on. So I think the normal assumption is that a piece of software logs to STDOUT only so that if I run it with something like |
|
|
|
@mistercrunch I have configured timeRotateLogRotation which is often needed when this application runs over large scale - logs can then be distributed across multiple files automatically based on rollover time (in this case every midnight new file will be created). Also I have reverted back all logger statements to print (in master), so people can configure how they want to log. TimeRotate is also configurable in conifg. |
|
|
||
| # Logging configuration | ||
| logging.basicConfig(format='%(asctime)s:%(levelname)s:%(name)s:%(message)s') | ||
| logging.getLogger().setLevel(logging.DEBUG) |
There was a problem hiding this comment.
if only two things was to get parameterized it should be the logging level and the format string
|
This is good to go, you just need to rebase... |
# Conflicts: # caravel/config.py # caravel/viz.py
* SO-218: Reworked report edit panel * SO-218: Added Report Flyout to Dashboard * SO-218: Lint fix * Update superset-frontend/src/features/reports/ReportFlyout.tsx Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * SO-218: Fix import --------- Co-authored-by: Joey Andres <jandres@joeyandres.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
No description provided.