postgREST log add customs fields #3151
-
Hi all , I need one help 127.0.0.1 - postgres [10/Jan/2024:10:55:27 +0530] "GET /subscription_user_role_mapping?UserId=eq.110000 HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" 127.0.0.1 - postgres [10/Jan/2024:10:55:28 +0530] "GET /subscription_client_users?ClientId=eq.1100001 HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" I need to add userid in this log like that user id i send headers userid filed is there any options available for add new filed in log format ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If you go for "one postgres role per user", then the user ID would already show up - not the 3rd field in the log which is https://docs.postgrest.org/en/v12/references/auth.html#jwt-based-user-impersonation |
Beta Was this translation helpful? Give feedback.
-
No, that's not possible. |
Beta Was this translation helpful? Give feedback.
If you go for "one postgres role per user", then the user ID would already show up - not the 3rd field in the log which is
postgres
. This will be the current user for the request as taken from the JWT.https://docs.postgrest.org/en/v12/references/auth.html#jwt-based-user-impersonation