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/mariadb/howto-configure-server-logs-cli.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ ms.author: andrela
6
6
ms.service: mariadb
7
7
ms.devlang: azurecli
8
8
ms.topic: conceptual
9
-
ms.date: 3/18/2020
9
+
ms.date: 4/13/2020
10
10
---
11
11
# Configure and access slow query logs by using Azure CLI
12
12
You can download the Azure Database for MariaDB slow query logs by using Azure CLI, the Azure command-line utility.
@@ -16,30 +16,32 @@ To step through this how-to guide, you need:
16
16
-[Azure Database for MariaDB server](quickstart-create-mariadb-server-database-using-azure-cli.md)
17
17
- The [Azure CLI](/cli/azure/install-azure-cli) or Azure Cloud Shell in the browser
18
18
19
-
## Configure logging for Azure Database for MariaDB
20
-
You can configure the server to access the MariaDB slow query log by taking the following steps:
21
-
1. Turn on logging by setting the **slow\_query\_log** parameter to ON.
22
-
2. Adjust other parameters, such as **long\_query\_time** and **log\_slow\_admin\_statements**.
19
+
## Configure logging
20
+
You can configure the server to access the MySQL slow query log by taking the following steps:
21
+
1. Turn on slow query logging by setting the **slow\_query\_log** parameter to ON.
22
+
2. Select where to output the logs to using **log\_output**. To send logs to both local storage and Azure Monitor Diagnostic Logs, select **File**. To send logs only to Azure Monitor Logs, select **None**
23
+
3. Adjust other parameters, such as **long\_query\_time** and **log\_slow\_admin\_statements**.
23
24
24
25
To learn how to set the value of these parameters through Azure CLI, see [How to configure server parameters](howto-configure-server-parameters-cli.md).
25
26
26
27
For example, the following CLI command turns on the slow query log, sets the long query time to 10 seconds, and then turns off the logging of the slow admin statement. Finally, it lists the configuration options for your review.
27
28
```azurecli-interactive
28
29
az mariadb server configuration set --name slow_query_log --resource-group myresourcegroup --server mydemoserver --value ON
30
+
az mariadb server configuration set --name log_output --resource-group myresourcegroup --server mydemoserver --value FILE
29
31
az mariadb server configuration set --name long_query_time --resource-group myresourcegroup --server mydemoserver --value 10
30
32
az mariadb server configuration set --name log_slow_admin_statements --resource-group myresourcegroup --server mydemoserver --value OFF
31
33
az mariadb server configuration list --resource-group myresourcegroup --server mydemoserver
32
34
```
33
35
34
36
## List logs for Azure Database for MariaDB server
35
-
To list the available slow query log files for your server, run the [az mariadb server-logs list](/cli/azure/mariadb/server-logs#az-mariadb-server-logs-list) command.
37
+
If **log_output** is configured to "File", you can access logs directly from the server's local storage. To list the available slow query log files for your server, run the [az mariadb server-logs list](/cli/azure/mariadb/server-logs#az-mariadb-server-logs-list) command.
36
38
37
39
You can list the log files for server **mydemoserver.mariadb.database.azure.com** under the resource group **myresourcegroup**. Then direct the list of log files to a text file called **log\_files\_list.txt**.
38
40
```azurecli-interactive
39
41
az mariadb server-logs list --resource-group myresourcegroup --server mydemoserver > log_files_list.txt
40
42
```
41
43
## Download logs from the server
42
-
With the [az mariadb server-logs download](/cli/azure/mariadb/server-logs#az-mariadb-server-logs-download) command, you can download individual log files for your server.
44
+
If **log_output** is configured to "File", you can download individual log files from your server with the [az mariadb server-logs download](/cli/azure/mariadb/server-logs#az-mariadb-server-logs-download) command.
43
45
44
46
Use the following example to download the specific log file for the server **mydemoserver.mariadb.database.azure.com** under the resource group **myresourcegroup** to your local environment.
Copy file name to clipboardExpand all lines: articles/mariadb/howto-configure-server-logs-portal.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: ajlam
5
5
ms.author: andrela
6
6
ms.service: mariadb
7
7
ms.topic: conceptual
8
-
ms.date: 3/18/2020
8
+
ms.date: 4/13/2020
9
9
---
10
10
11
11
# Configure and access slow query logs from the Azure portal
@@ -27,11 +27,17 @@ Configure access to the slow query log.
27
27
28
28
4. To see the server parameters, select **Click here to enable logs and configure log parameters**.
29
29
30
-
5.Change the parameters that you need to adjust, including turning **slow_query_log** to **ON**. All changes you make in this session are highlighted in purple.
30
+
5.Turn **slow_query_log** to **ON**.
31
31
32
-
After you have changed the parameters, select **Save**. Or, you can discard your changes.
32
+
6. Select where to output the logs to using **log_output**. To send logs to both local storage and Azure Monitor Diagnostic Logs, select **File**.
33
33
34
-

34
+
7. Change any other parameters needed.
35
+
36
+
8. Select **Save**.
37
+
38
+
:::image type="content" source="/media/howto-configure-server-logs-portal/3-save-discard.png" alt-text="Update slow query log parameters and save.":::
39
+
40
+
<!-- -->
35
41
36
42
From the **Server Parameters** page, you can return to the list of logs by closing the page.
Copy file name to clipboardExpand all lines: articles/mysql/howto-configure-server-logs-in-cli.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ ms.author: andrela
6
6
ms.service: mysql
7
7
ms.devlang: azurecli
8
8
ms.topic: conceptual
9
-
ms.date: 3/18/2020
9
+
ms.date: 4/13/2020
10
10
---
11
11
# Configure and access slow query logs by using Azure CLI
12
12
You can download the Azure Database for MySQL slow query logs by using Azure CLI, the Azure command-line utility.
@@ -19,27 +19,29 @@ To step through this how-to guide, you need:
19
19
## Configure logging
20
20
You can configure the server to access the MySQL slow query log by taking the following steps:
21
21
1. Turn on slow query logging by setting the **slow\_query\_log** parameter to ON.
22
-
2. Adjust other parameters, such as **long\_query\_time** and **log\_slow\_admin\_statements**.
22
+
2. Select where to output the logs to using **log\_output**. To send logs to both local storage and Azure Monitor Diagnostic Logs, select **File**. To send logs only to Azure Monitor Logs, select **None**
23
+
3. Adjust other parameters, such as **long\_query\_time** and **log\_slow\_admin\_statements**.
23
24
24
25
To learn how to set the value of these parameters through Azure CLI, see [How to configure server parameters](howto-configure-server-parameters-using-cli.md).
25
26
26
27
For example, the following CLI command turns on the slow query log, sets the long query time to 10 seconds, and then turns off the logging of the slow admin statement. Finally, it lists the configuration options for your review.
27
28
```azurecli-interactive
28
29
az mysql server configuration set --name slow_query_log --resource-group myresourcegroup --server mydemoserver --value ON
30
+
az mysql server configuration set --name log_output --resource-group myresourcegroup --server mydemoserver --value FILE
29
31
az mysql server configuration set --name long_query_time --resource-group myresourcegroup --server mydemoserver --value 10
30
32
az mysql server configuration set --name log_slow_admin_statements --resource-group myresourcegroup --server mydemoserver --value OFF
31
33
az mysql server configuration list --resource-group myresourcegroup --server mydemoserver
32
34
```
33
35
34
36
## List logs for Azure Database for MySQL server
35
-
To list the available slow query log files for your server, run the [az mysql server-logs list](/cli/azure/mysql/server-logs#az-mysql-server-logs-list) command.
37
+
If **log_output** is configured to "File", you can access logs directly from the server's local storage. To list the available slow query log files for your server, run the [az mysql server-logs list](/cli/azure/mysql/server-logs#az-mysql-server-logs-list) command.
36
38
37
39
You can list the log files for server **mydemoserver.mysql.database.azure.com** under the resource group **myresourcegroup**. Then direct the list of log files to a text file called **log\_files\_list.txt**.
38
40
```azurecli-interactive
39
41
az mysql server-logs list --resource-group myresourcegroup --server mydemoserver > log_files_list.txt
40
42
```
41
43
## Download logs from the server
42
-
With the [az mysql server-logs download](/cli/azure/mysql/server-logs#az-mysql-server-logs-download) command, you can download individual log files for your server.
44
+
If **log_output** is configured to "File", you can download individual log files from your server with the [az mysql server-logs download](/cli/azure/mysql/server-logs#az-mysql-server-logs-download) command.
43
45
44
46
Use the following example to download the specific log file for the server **mydemoserver.mysql.database.azure.com** under the resource group **myresourcegroup** to your local environment.
0 commit comments