pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.45k stars 641 forks source link

show PostgreSQL server log (RM #6037) #3981

Closed dpage closed 2 months ago

dpage commented 3 years ago

Issue migrated from Redmine: https://redmine.postgresql.org/issues/6037 Originally created by Frank Limpert at 2020-11-24 15:09:50 UTC.

In pgAdmin3 (see attached screen shot), I can have a look inside the most recent PostgreSQL server log file. This helps me especially to tune SQL commands inside of functions using auto_explain et al. This feature would be especially helpful for developers not having shell access to their PostgreSQL server.

Older PostgreSQL servers might need EXTENSION adminpack for this. Newer PostgreSQL versions have pg_read_file().

dpage commented 3 years ago

Image migrated from Redmine: https://redmine.postgresql.org/attachments/download/5468 Originally created by Frank Limpert at 2020-11-24 15:08:36 UTC.

ServerStatus.png

Filename: ServerStatus.png

Description: pgAdmin3 screen shot

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6037#note-2 Originally created by Yogesh Mahajan at 2020-12-04 11:37:25 UTC.

Redmine ticket header update:

Name Old Value New Value
Sprint changed Ready
ronwildt commented 1 year ago

@akshay-joshi Thank you for identifying my enhancement request as a duplicate #6696 What is the timeframe for implementing this feature and why was it removed from pgadmin4 in the first place, my I ask? Thanks!

akshay-joshi commented 1 year ago

@ronwildt

We have completely rewritten pgAdmin 4 in React/ Python and other web technologies. pgAdmin III is c++ based standalone application. pgAdmin 4 is a web + desktop application. We will prioritize it.

ronwildt commented 1 year ago

@akshay-joshi The info is appreciated. When might the team be adding this to the backlog and what might be the ETA for delivery of the feature? (looking to know for planning purposes on our end, fyi.) Thanks! :)

akshay-joshi commented 1 year ago

@ronwildt

Will see the feasibility and if possible will try to add this to the next release 7.7 on 21st September.

ronwildt commented 1 year ago

@akshay-joshi That would be totally awesome! Didn't expect the team might be able to do so that quickly. Looking forward to it. Have a great weekend, thx. :)

akshay-joshi commented 1 year ago

@ronwildt

We have check the feasibility, this feature is not straightforward and seems to be very complex. So definitely it won't be there in the next release v7.7

ronwildt commented 1 year ago

@akshay-joshi We appreciate the update and I figured it would not be easy if not already in development. Any idea when the feature may be planned and implemented?

akshay-joshi commented 1 year ago

@ronwildt

We will check the feasibility/analysis first and then we can priorities.

ronwildt commented 1 year ago

@akshay-joshi Sounds good, looking forward to learning about ETA on inclusion in pgadmin4! Have a great Labor Day weekend! :)

yogeshmahajan-1903 commented 3 months ago

1.Getting error while loading pg1 logs

Screenshot 2024-07-04 at 11 57 19 AM

logs -

2024-07-08 15:23:13,005: ERROR  pgadmin:    tuple indices must be integers or slices, not str
Traceback (most recent call last):
  File "/usr/pgadmin4/venv/lib/python3.11/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pgadmin4/venv/lib/python3.11/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pgadmin4/venv/lib/python3.11/site-packages/flask_login/utils.py", line 290, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pgadmin4/web/pgadmin/authenticate/mfa/utils.py", line 304, in inner
    return mfa_enabled(
           ^^^^^^^^^^^^
  File "/usr/pgadmin4/web/pgadmin/authenticate/mfa/utils.py", line 171, in mfa_enabled
    return execute_if_disabled()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pgadmin4/web/pgadmin/authenticate/mfa/utils.py", line 297, in execute_func
    return wrapped(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pgadmin4/web/pgadmin/user_login_check.py", line 22, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/pgadmin4/web/pgadmin/dashboard/precondition.py", line 74, in wrap
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/pgadmin4/web/pgadmin/dashboard/__init__.py", line 624, in logs
    final_response = res['rows']
                     ~~~^^^^^^^^
TypeError: tuple indices must be integers or slices, not str

2.Add tool tip/help text for join and csv format.

3.Refresh button should be one at top.

4.Values for Granted column shown undefined -

Screenshot 2024-07-04 at 1 50 58 PM

All Fixed

pravesh-sharma commented 2 months ago
  1. Loading / no message is being displayed for disconnected servers

image

Screenshot 2024-07-08 at 10 54 48 AM

Fixed

yogeshmahajan-1903 commented 2 months ago

Some more issues - 1.Format of logs shown in text area does not change on changing log format.

Screenshot 2024-07-09 at 1 14 51 PM Screenshot 2024-07-09 at 1 14 56 PM

Fixed 2.Download button for logs can be moved on left top corner inline with Log format field.

3.Scroll bar appears while changing log format. Fixed

4.Get fixed rows for all 3 sections and add scroll. Let's discuss with team

5.Logs get re-rendered on selection change of any db object. It should be only on server selection change.xed If user directly selects another server's db then how will you identify?

yogeshmahajan-1903 commented 2 months ago

1.Getting error below while selecting not connected server.

Screenshot 2024-07-11 at 11 33 20 AM

2.Despite of disabled json format logging, I can select json format.

Screenshot 2024-07-12 at 11 14 18 AM Screenshot 2024-07-12 at 11 14 24 AM

3.Message displayed when there is no log file seems to incorrect - 'Enable logging for server'. Logging is always enabled, only case file is not present or empty.

Screenshot 2024-07-12 at 11 17 41 AM
yogeshmahajan-1903 commented 2 months ago

All issues are fixed.