Skip to content
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

Closed
wants to merge 0 commits into from

Conversation

khushboovashi
Copy link
Contributor

No description provided.

Copy link
Contributor

@akshay-joshi akshay-joshi left a 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.

Comment on lines 565 to 568
@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')
Copy link
Contributor

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?

endpoint='get_logs_by_server_id')
@login_required
@check_precondition
def logs(frm=None, md=None, sid=None, page=0):
Copy link
Contributor

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

Comment on lines 598 to 599
st = 0
ed = ON_DEMAND_LOG_COUNT
Copy link
Contributor

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

Comment on lines 644 to 645
col1 = []
col2 = []
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unused variables.

_pattern = re.compile(LOG_STATEMENTS)
for f in final_res:
tmp = re.search(LOG_STATEMENTS, f)
fsp = _pattern.split(f)
Copy link
Contributor

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*/
Copy link
Contributor

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*/
Copy link
Contributor

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 }});
Copy link
Contributor

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

LOG_STATEMENTS = 'DEBUG:|STATEMENT:|LOG:|WARNING:|NOTICE:|INFO:' \
'|ERROR:|FATAL:|PANIC:'
if not sid:
return internal_server_error(errormsg='Server ID not specified.')
Copy link
Contributor

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.

@@ -228,6 +228,7 @@ def validate_binary_path():
running the utilities with their versions.
"""
data = None
return precondition_required(gettext('Invalid binary path.'))
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants