-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improving database logging by adding duration, referrer and post data (…
…#1830) * Improving logging with duration and referrer * Handling case where referrer is None * Providing log_this with its own session * Attempting to fix tests * Fixing tests
- Loading branch information
1 parent
36fad80
commit 0712894
Showing
4 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
superset/migrations/versions/525c854f0005_log_this_plus.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""log_this_plus | ||
Revision ID: 525c854f0005 | ||
Revises: e46f2d27a08e | ||
Create Date: 2016-12-13 16:19:02.239322 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '525c854f0005' | ||
down_revision = 'e46f2d27a08e' | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
op.add_column('logs', sa.Column('duration_ms', sa.Integer(), nullable=True)) | ||
op.add_column('logs', sa.Column('referrer', sa.String(length=1024), nullable=True)) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column('logs', 'referrer') | ||
op.drop_column('logs', 'duration_ms') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"""empty message | ||
Revision ID: 6414e83d82b7 | ||
Revises: ('525c854f0005', 'f1f2d4af5b90') | ||
Create Date: 2016-12-19 09:57:05.814013 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '6414e83d82b7' | ||
down_revision = ('525c854f0005', 'f1f2d4af5b90') | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
pass | ||
|
||
|
||
def downgrade(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters