Skip to content

enable timerotateloghandler (configurable)#311

Merged
mistercrunch merged 21 commits intoapache:masterfrom
sid88in:enhance_logging
May 1, 2016
Merged

enable timerotateloghandler (configurable)#311
mistercrunch merged 21 commits intoapache:masterfrom
sid88in:enhance_logging

Conversation

@sid88in
Copy link
Copy Markdown
Contributor

@sid88in sid88in commented Apr 10, 2016

No description provided.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 72.536% when pulling ef97c65 on sid88in:enhance_logging into f8e5d30 on airbnb:master.

@sid88in
Copy link
Copy Markdown
Contributor Author

sid88in commented Apr 10, 2016

@mistercrunch I am testing this PR to enhance logging in caravel. Reference:

  1. http://docs.python-guide.org/en/latest/writing/logging/
  2. https://docs.python.org/2/library/logging.config.html

Comment thread caravel/caravel_logging.py Outdated
2) https://docs.python.org/2/library/logging.config.html
"""

from caravel import app
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that creates a circular import

@mistercrunch
Copy link
Copy Markdown
Member

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 conf.py instead. To avoid circular imports you can simply use a function that receives the app configuration and returns the loggingconfig object perhaps.

@sid88in
Copy link
Copy Markdown
Contributor Author

sid88in commented Apr 10, 2016

Cool. Looking into it.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 72.525% when pulling 58825e6 on sid88in:enhance_logging into f8e5d30 on airbnb:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 72.547% when pulling 9452905 on sid88in:enhance_logging into f8e5d30 on airbnb:master.

Comment thread caravel/bin/caravel Outdated
from caravel import db

config = app.config
logging.config.dictConfig(config.get('LOGGING_CONFIG'))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sid88in

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats a good catch. I tested it after removing the redundant declaration and it works.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.1%) to 72.47% when pulling 50bb311 on sid88in:enhance_logging into f8e5d30 on airbnb:master.

Comment thread caravel/bin/caravel Outdated
"""Starts a Caravel web server"""
debug = debug or config.get("DEBUG")
if debug:
debug = config.get('LOG_LEVEL')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug meant something else here (whether the web server should run in debug mode). We should keep that insulated from the logging level.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.4%) to 72.695% when pulling e408332 on sid88in:enhance_logging into f8e5d30 on airbnb:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.4%) to 72.695% when pulling e408332 on sid88in:enhance_logging into f8e5d30 on airbnb:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.4%) to 72.695% when pulling e408332 on sid88in:enhance_logging into f8e5d30 on airbnb:master.

@landscape-bot
Copy link
Copy Markdown

Code Health
Repository health decreased by 0.11% when pulling e408332 on sid88in:enhance_logging into f8e5d30 on airbnb:master.

3 similar comments
@landscape-bot
Copy link
Copy Markdown

Code Health
Repository health decreased by 0.11% when pulling e408332 on sid88in:enhance_logging into f8e5d30 on airbnb:master.

@landscape-bot
Copy link
Copy Markdown

Code Health
Repository health decreased by 0.11% when pulling e408332 on sid88in:enhance_logging into f8e5d30 on airbnb:master.

@landscape-bot
Copy link
Copy Markdown

Code Health
Repository health decreased by 0.11% when pulling e408332 on sid88in:enhance_logging into f8e5d30 on airbnb:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.3%) to 72.684% when pulling 7f82849 on sid88in:enhance_logging into f8e5d30 on airbnb:master.

@mistercrunch
Copy link
Copy Markdown
Member

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 runit or sv it will do its own log rotation and all that. Can we make the default to only log to STDOUT and make it easy and clear for people to configure it to log differently?

@sid88in sid88in changed the title attempt to enchance logging enable timerotateloghandler (configurable) Apr 17, 2016
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.04%) to 72.511% when pulling e5ae4ab on sid88in:enhance_logging into 899fe19 on airbnb:master.

@landscape-bot
Copy link
Copy Markdown

Code Health
Repository health decreased by 0.01% when pulling e624c41 on sid88in:enhance_logging into 899fe19 on airbnb:master.

@sid88in
Copy link
Copy Markdown
Contributor Author

sid88in commented Apr 17, 2016

@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.

@landscape-bot
Copy link
Copy Markdown

Code Health
Code quality remained the same when pulling 1f81a98 on sid88in:enhance_logging into 899fe19 on airbnb:master.

@landscape-bot
Copy link
Copy Markdown

Code Health
Code quality remained the same when pulling 1f81a98 on sid88in:enhance_logging into 899fe19 on airbnb:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.03%) to 72.443% when pulling 8cd0764 on sid88in:enhance_logging into 899fe19 on airbnb:master.

@landscape-bot
Copy link
Copy Markdown

Code Health
Code quality remained the same when pulling 8cd0764 on sid88in:enhance_logging into 899fe19 on airbnb:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.03%) to 72.443% when pulling 8cd0764 on sid88in:enhance_logging into 899fe19 on airbnb:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.002%) to 72.468% when pulling 8cd0764 on sid88in:enhance_logging into 899fe19 on airbnb:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.001%) to 72.471% when pulling 8cd0764 on sid88in:enhance_logging into 899fe19 on airbnb:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.001%) to 72.471% when pulling 8cd0764 on sid88in:enhance_logging into 899fe19 on airbnb:master.

Comment thread caravel/__init__.py Outdated

# Logging configuration
logging.basicConfig(format='%(asctime)s:%(levelname)s:%(name)s:%(message)s')
logging.getLogger().setLevel(logging.DEBUG)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if only two things was to get parameterized it should be the logging level and the format string

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@landscape-bot
Copy link
Copy Markdown

Code Health
Code quality remained the same when pulling 956c84d on sid88in:enhance_logging into 899fe19 on airbnb:master.

@mistercrunch
Copy link
Copy Markdown
Member

This is good to go, you just need to rebase...

# Conflicts:
#	caravel/config.py
#	caravel/viz.py
@landscape-bot
Copy link
Copy Markdown

Code Health
Code quality remained the same when pulling 9f328e5 on sid88in:enhance_logging into 7b5b602 on airbnb:master.

@coveralls
Copy link
Copy Markdown

coveralls commented May 1, 2016

Coverage Status

Coverage decreased (-0.02%) to 80.967% when pulling 9f328e5 on sid88in:enhance_logging into 7b5b602 on airbnb:master.

@mistercrunch mistercrunch merged commit d7ea473 into apache:master May 1, 2016
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.9.0 First shipped in 0.9.0 labels Feb 19, 2024
isaac-jaynes-imperva added a commit to isaac-jaynes-imperva/superset that referenced this pull request Mar 3, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.9.0 First shipped in 0.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants