question

sappusolanki-6708 avatar image
0 Votes"
sappusolanki-6708 asked sappusolanki-6708 commented

Server logs option in Azure PostgreSQL Flexible Server

I am currently using Azure PostgreSQL single server and planning to upgrade to Azure PostgreSQL Flexible Server.
One of the drawback I came across was "Server Logs" option is not available under Monitoring pane in Azure PostgreSQL Flexible Server.
This is easily available in Azure PostgreSQL Single Server which generates nice logs output on hourly basis.
Can anyone help me with where to find such Server Logs option in Azure PostgreSQL Flexible Server or any alternate option where logs will be generated on hourly basis ??

azure-database-postgresql
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AnuragSharma-MSFT avatar image
0 Votes"
AnuragSharma-MSFT answered sappusolanki-6708 commented

Hi @sappusolanki-6708, welcome to Microsoft Q&A forum.

As I understand, you would like to access the server logs in Azure PostgreSQL - Flexible Server similar to Single Server.

To achieve this, we need to configure Monitoring -> Diagnostic Settings as mentioned in the below screenshot. Then we need to choose one of destination details (like Log Analytics Store) that will store our logs:

197402-image.png

Once this is configured, the logs will flow to Azure Log Analytics workspace and we can run below query to get them.

 AzureDiagnostics 
 | where Category == "PostgreSQLLogs"

197334-image.png

Referenced Article: Configure and Access Logs in Azure Database for PostgreSQL - Flexible Server

Please let us know if this helps or else we can discuss further on the same.


If answer is helpful please click on 197412-image.png as it could help other members of the Microsoft Q&A community who have similar questions and are looking for solutions. Thank you for helping to improve Microsoft Q&A!




image.png (45.6 KiB)
image.png (123.4 KiB)
image.png (4.5 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @sappusolanki-6708, just wanted to check if above answer helps your query, or else we can discuss further on the same.

0 Votes 0 ·

Hi @AnuragSharma-MSFT, thanks for quick response.
I tried creating Diagnostic setting with Option selected as PostgreSQLLogs with "Send to Analystics Workspace" and "Archive to Storage account".
But when I run query provided by you i.e AzureDiagnostics | where Category == "PostgreSQLLogs", every time it brings blank result stating "No result found".
I even tried setting a custom filter such as last 1 month, but still the result is blank.
Can you please suggest me the reason for blank reason?

0 Votes 0 ·

Thanks for replying back. It usually takes some time for logs to get ingested. Can you please try it after 30 mins or 1 hour for the first time?

I waited for around 30 minutes and can see all the logs as shown in below picture:


198861-image.png


0 Votes 0 ·
image.png (99.7 KiB)
Show more comments