You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/postgresql/concepts-audit.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: rachel-msft
5
5
ms.author: raagyema
6
6
ms.service: postgresql
7
7
ms.topic: conceptual
8
-
ms.date: 10/14/2019
8
+
ms.date: 01/28/2020
9
9
---
10
10
11
11
# Audit logging in Azure Database for PostgreSQL - Single Server
@@ -60,10 +60,8 @@ pgAudit allows you to configure session or object audit logging. [Session audit
60
60
Once you have [installed pgAudit](#installing-pgaudit), you can configure its parameters to start logging. The [pgAudit documentation](https://github.com/pgaudit/pgaudit/blob/master/README.md#settings) provides the definition of each parameter. Test the parameters first and confirm that you are getting the expected behavior.
61
61
62
62
> [!NOTE]
63
-
> Setting `pgaudit.log_client` to ON will redirect logs to a client process (like psql) instead of being written to file. This setting should generally be left disabled.
64
-
65
-
> [!NOTE]
66
-
>`pgaudit.log_level` is only enabled when `pgaudit.log_client` is on. Also, in the Azure portal, there is currently a bug with `pgaudit.log_level`: a combo box is shown, implying that multiple levels can be selected. However, only one level should be selected.
63
+
> Setting `pgaudit.log_client` to ON will redirect logs to a client process (like psql) instead of being written to file. This setting should generally be left disabled. <br><br>
64
+
>`pgaudit.log_level` is only enabled when `pgaudit.log_client` is on.
67
65
68
66
> [!NOTE]
69
67
>In Azure Database for PostgreSQL, `pgaudit.log` cannot be set using a `-` (minus) sign shortcut as described in the pgAudit documentation. All required statement classes (READ, WRITE etc) should be individually specified.
@@ -82,6 +80,22 @@ To learn more about `log_line_prefix`, visit the [PostgreSQL documentation](http
82
80
### Getting started
83
81
To quickly get started, set `pgaudit.log` to `WRITE`, and open your logs to review the output.
84
82
83
+
## Viewing audit logs
84
+
If you are using .log files, your audit logs will be included in the same file as your PostgreSQL error logs. You can download log files from the Azure [portal](howto-configure-server-logs-in-portal.md) or [CLI](howto-configure-server-logs-using-cli.md).
85
+
86
+
If you are using Azure diagnostic logging, the way you access the logs depends on which endpoint you choose. For Azure Storage, see the [logs storage account](../azure-monitor/platform/resource-logs-collect-storage.md) article. For Event Hubs, see the [stream Azure logs](../azure-monitor/platform/resource-logs-stream-event-hubs.md) article.
87
+
88
+
For Azure Monitor Logs, logs are sent to the workspace you selected. The Postgres logs use the **AzureDiagnostics** collection mode, so they can be queried from the AzureDiagnostics table. The fields in the table are described below. Learn more about querying and alerting in the [Azure Monitor Logs query](../azure-monitor/log-query/log-query-overview.md) overview.
89
+
90
+
You can use this query to get started. You can configure alerts based on queries.
91
+
92
+
Search for all Postgres logs for a particular server in the last day
93
+
```
94
+
AzureDiagnostics
95
+
| where LogicalServerName_s == "myservername"
96
+
| where TimeGenerated > ago(1d)
97
+
| where Message contains "AUDIT:"
98
+
```
85
99
86
100
## Next steps
87
101
- [Learn about logging in Azure Database for PostgreSQL](concepts-server-logs.md)
Copy file name to clipboardExpand all lines: articles/postgresql/concepts-limits.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,15 @@ author: rachel-msft
5
5
ms.author: raagyema
6
6
ms.service: postgresql
7
7
ms.topic: conceptual
8
-
ms.date: 06/25/2019
8
+
ms.date: 01/28/2020
9
9
ms.custom: fasttrack-edit
10
10
---
11
11
# Limits in Azure Database for PostgreSQL - Single Server
12
12
The following sections describe capacity and functional limits in the database service. If you'd like to learn about resource (compute, memory, storage) tiers, see the [pricing tiers](concepts-pricing-tiers.md) article.
13
13
14
14
15
15
## Maximum connections
16
-
The maximum number of connections per pricing tier and vCores are as follows:
16
+
The maximum number of connections per pricing tier and vCores are shown below. The Azure system requires five connections to monitor the Azure Database for PostgreSQL server.
17
17
18
18
|**Pricing Tier**|**vCore(s)**|**Max Connections**|**Max User Connections**|
19
19
|---|---|---|---|
@@ -34,7 +34,10 @@ The maximum number of connections per pricing tier and vCores are as follows:
34
34
When connections exceed the limit, you may receive the following error:
35
35
> FATAL: sorry, too many clients already
36
36
37
-
The Azure system requires five connections to monitor the Azure Database for PostgreSQL server.
37
+
> [!IMPORTANT]
38
+
> For best experience, we recommend that you use a connection pooler like pgBouncer to efficiently manage connections.
39
+
40
+
A PostgreSQL connection, even idle, can occupy about 10MB of memory. Also, creating new connections takes time. Most applications request many short-lived connections, which compounds this situation. The result is fewer resources available for your actual workload leading to decreased performance. A connection pooler that decreases idle connections and reuses existing connections will help avoid this. To learn more, visit our [blog post](https://techcommunity.microsoft.com/t5/azure-database-for-postgresql/not-all-postgres-connection-pooling-is-equal/ba-p/825717).
Copy file name to clipboardExpand all lines: articles/postgresql/concepts-server-logs.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ To enable Diagnostic logs using Powershell, CLI, or REST API, visit the [diagnos
64
64
65
65
### Access diagnostic logs
66
66
67
-
The way you access the logs depends on which endpoint you choose. For Azure Storage, the schema is described in the [logs storage account](../azure-monitor/platform/resource-logs-collect-storage.md) article. For Event Hubs, see the [stream Azure logs](../azure-monitor/platform/resource-logs-stream-event-hubs.md) article.
67
+
The way you access the logs depends on which endpoint you choose. For Azure Storage, see the [logs storage account](../azure-monitor/platform/resource-logs-collect-storage.md) article. For Event Hubs, see the [stream Azure logs](../azure-monitor/platform/resource-logs-stream-event-hubs.md) article.
68
68
69
69
For Azure Monitor Logs, logs are sent to the workspace you selected. The Postgres logs use the **AzureDiagnostics** collection mode, so they can be queried from the AzureDiagnostics table. The fields in the table are described below. Learn more about querying and alerting in the [Azure Monitor Logs query](../azure-monitor/log-query/log-query-overview.md) overview.
70
70
@@ -73,7 +73,7 @@ The following are queries you can try to get started. You can configure alerts b
73
73
Search for all Postgres logs for a particular server in the last day
0 commit comments