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
Show PostgreSQL Server Log. #3981 #7381
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GUI Related:
- Encountering the error "cannot access the local variable 'final_cols' where it is not associated with a value." when clicking on 'Table Based logs'.
- I think we should shift the entire "Server activity" tab near to "System Statistics"?
- We should display all available log formats and enable only those specified in the 'log_destination'.
- 'View the active session details" and 'View the log details' not working properly, and controls are not visible and overlapped.
- Clicking on the search box of each column is inadvertently sorting the column, which should not occur.
- The toggle button separator should be visible when selecting 'Text'. However, there is no separator between JSON and CSV.
- Remove the colon ":" from "LOG:" and "DEBUG:" from the values under 'Error Severity'.
- Rename the 'Error Severity' column to 'Log Mode' or 'Log Type', or a similar descriptive term. I know the term is from PostgreSQL, but LOG, and DEBUG messages are not errors.
- Rename the label 'Table Based Logs' to 'Show logs in tabular format?' or a similar descriptive term.
- On clicking the 'Table Based Logs' label switch control toggles its state.
- Timestamp/Log prefix not visible in the 'Text' mode.
- We should read all the files. Needs to be confirmed.
- Unnessary verticle Scroll Bar is visible on the Dashboard. This is not because of this PR but can you please look into it?
- Logs are missing in the 'Table Based logs' as it is visible in the file-based. Please check once.
- Reduce the width of the 'Error Severity', and ''View the log details' columns (if possible)
Code Related:
- Add Documentation.
- JavaScript tests are failing.
- Fixed SonarQube issues that were newly added with this PR.
- Add proper comments in the functions wherever applicable.
- In PgTable.jsx please correct the spelling of 'CLOUMNS'. Not in your PR but we should fix it.
web/pgadmin/dashboard/__init__.py
Outdated
@blueprint.route('/logs/<frm>/<md>/<int:sid>/<int:page>', | ||
endpoint='get_logs_by_server_id') | ||
@blueprint.route('/logs/<frm>/<md>/<int:sid>/<int:page>/', | ||
endpoint='get_logs_by_server_id') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need both of these routes?
web/pgadmin/dashboard/__init__.py
Outdated
endpoint='get_logs_by_server_id') | ||
@login_required | ||
@check_precondition | ||
def logs(frm=None, md=None, sid=None, page=0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please give meaningful names to the variables "frm", and "md".
web/pgadmin/dashboard/__init__.py
Outdated
st = 0 | ||
ed = ON_DEMAND_LOG_COUNT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please give meaningful names to the variables "st", and "ed".
web/pgadmin/dashboard/__init__.py
Outdated
col1 = [] | ||
col2 = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused variables.
web/pgadmin/dashboard/__init__.py
Outdated
_pattern = re.compile(LOG_STATEMENTS) | ||
for f in final_res: | ||
tmp = re.search(LOG_STATEMENTS, f) | ||
fsp = _pattern.split(f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused variable.
@@ -0,0 +1,6 @@ | |||
/*pga4dash*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove it.
@@ -0,0 +1,8 @@ | |||
/*pga4dash*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove it.
@@ -0,0 +1,8 @@ | |||
/*pga4dash*/ | |||
{% if log_format != '' %} | |||
SELECT pg_read_file(pg_current_logfile('{{log_format}}'), {{ st }}, {{ ed }}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please give meaningful names to the variables "st", and "ed".
web/pgadmin/dashboard/__init__.py
Outdated
LOG_STATEMENTS = 'DEBUG:|STATEMENT:|LOG:|WARNING:|NOTICE:|INFO:' \ | ||
'|ERROR:|FATAL:|PANIC:' | ||
if not sid: | ||
return internal_server_error(errormsg='Server ID not specified.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Server ID not specified.' should be wrapped into the gettext. Maybe create a constant and replace it on 7 other places.
web/pgadmin/misc/__init__.py
Outdated
@@ -228,6 +228,7 @@ def validate_binary_path(): | |||
running the utilities with their versions. | |||
""" | |||
data = None | |||
return precondition_required(gettext('Invalid binary path.')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this code as it always returns 'Invalid binary path.'
No description provided.