Skip to content

Commit f259e92

Browse files
authored
Merge pull request #261342 from code-sidd/new_error_log
erro log and other changes
2 parents c192704 + 4bd1a67 commit f259e92

File tree

7 files changed

+99
-11
lines changed

7 files changed

+99
-11
lines changed

articles/mysql/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120
href: flexible-server/concepts-monitoring.md
121121
- name: Slow query Logs
122122
href: flexible-server/concepts-slow-query-logs.md
123+
- name: Error logs
124+
href: flexible-server/concepts-error-logs.md
123125
- name: Audit logs
124126
href: flexible-server/concepts-audit-logs.md
125127
- name: Workbooks
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: 'Error logs - Azure Database for MySQL - Flexible Server'
3+
description: This article describes the error logs feature for Azure Database for MySQL - Flexible Server.
4+
ms.service: mysql
5+
ms.subservice: flexible-server
6+
ms.topic: conceptual
7+
author: code-sidd
8+
ms.author: sisawant
9+
ms.date: 12/15/2023
10+
---
11+
12+
# Error logs in Azure Database for MySQL - Flexible Server (Preview)
13+
14+
[!INCLUDE[applies-to-mysql-flexible-server](../includes/applies-to-mysql-flexible-server.md)]
15+
16+
In Azure Database for MySQL - Flexible Server, the error log is available to users to configure and access. Error logs in MySQL gather diagnostic messages during server startup and shutdown, and while the server is running, information that can help proactive troubleshooting. For more information about the MySQL error log, see the [Error log](https://dev.mysql.com/doc/refman/8.0/en/error-log.html) section in the MySQL documentation.
17+
Under Preview phase, error logs are available under Server logs only, error logs **can't be emitted** to [Azure Diagnostic logs](./../../azure-monitor/essentials/platform-logs-overview.md).
18+
19+
>[!Note]
20+
>The Error Log feature is accessible for new servers created after *November 14, 2023, 00:00 UTC*. For existing servers, this feature will become available following their scheduled maintenance in January 2024. [Learn more about scheduled maintainence](./concepts-maintenance.md) on your server. To enable the Error Log feature on existing servers, before the scheduled maintainence, kindly contact us via [support ticket](./../../azure-portal/supportability/how-to-manage-azure-support-request.md).
21+
22+
In Azure Database for MySQL - Flexible Server, enabling the error log under [Server logs](./concepts-monitoring.md#server-logs) in the Azure portal records details in multiple files named using the syntax *mysql-error-servername-timestamp.log*. In the file name, the timestamp (in GMT/UTC) associated with when the file was generated is appended, identifying the specific time that that log entries were recorded. For more information, see [Server logs retention.](./concepts-monitoring.md#server-logs)
23+
24+
## Enabling error logs (Preview)
25+
26+
Users can access and configure the error logs in Azure Database for MySQL – Flexible Server via the Server logs feature, which can be enabled using the [Azure portal](./how-to-server-logs-portal.md#enable-server-logs) or [Azure CLI](./how-to-server-logs-cli.md).
27+
After the feature is enabled, your MySQL flexible server starts capturing events and writes them to a series of files saved as activity occurs.
28+
29+
To enable Error logs, perform the following steps.
30+
1. In the Azure portal, navigate to your flexible server, and then, under Monitoring, select Server logs.
31+
2. Under Server logs, select the Enable check box, which enables the server logs features
32+
3. Under Select logs to enable, select the Error logs check box.
33+
34+
:::image type="content" source="./media/concepts-error-logs/1-concepts-error-logs.png" alt-text="Screenshot of portal view showing Error Logs - Enable.":::
35+
36+
4. Select Save to proceed with deployment.
37+
38+
39+
You can also enable Error logs on your Azure Database for MySQL flexible server by [enabling the server parameter](./how-to-configure-server-parameters-portal.md) named *“error_server_log_file”* via the Server parameters pane or via the [Azure CLI](./how-to-configure-server-parameters-cli.md).
40+
41+
Ensure that the [Server logs feature](./how-to-server-logs-portal.md#enable-server-logs) is activated by selecting the *Enable* checkbox in the Server logs pane. Alternatively, set the server parameter "log_output" to FILE to enable server logs. Failure to perform either of these actions result in FILE logging not being enabled for your Azure Database for MySQL flexible server.
42+
43+
## Accessing error logs
44+
You can download the error logs for further analysis of your Azure Database for MySQL flexible server. To download the logs, in the Azure portal, navigate to the Server logs section, and then select the Error logs tab, as shown.
45+
- Under **Name**, select the log file you want to download, and then, under **Action**, select **Download**.
46+
47+
:::image type="content" source="./media/concepts-error-logs/2-concepts-error-logs.png" alt-text="Screenshot of portal view showing Error Logs - Download.":::
48+
49+
- To download *multiple log files* at one time, under **Name**, select the files you want to download, select **Download**.
50+
51+
:::image type="content" source="./media/concepts-error-logs/3-concepts-error-logs.png" alt-text="Screenshot of portal view showing Error Logs - Multiple Downloads.":::
52+
53+
54+
### Access error logs using Azure CLI
55+
You can list the server logs from your flexible server by using the following command.
56+
```azurecli
57+
az mysql flexible-server server-logs list --resource-group <myresourcegroup> --server-name <server_name> --out table
58+
```
59+
60+
To download the mentioned server logs to your current directory, use the following command:
61+
```azurecli
62+
az mysql flexible-server server-logs download --resource-group <myresourcegroup> --server-name <server_name> --name <mysql-error-<server_name>-<timestamp>.log>
63+
```
64+
65+
For more information, see [how to download the server logs files](./how-to-server-logs-portal.md#download-server-logs) via the Azure portal or via the [Azure CLI](./how-to-server-logs-cli.md#downloading-server-logs-using-azure-cli).
66+
67+
68+
### Error logs under server logs retention
69+
When logging is enabled for an Azure Database for MySQL - Flexible Server, logs are available up to seven days from their creation. If the total size of the available logs exceeds 7 GB, then the oldest files are deleted until space is available. The 7-GB storage limit for server logs is available free of cost and can't be extended. Logs are rotated every 24 hours or 500 MB, whichever comes first.
70+
Importantly, you can download the logs before rotation, ensuring they have access to valuable server logs at any point within the retention period.
71+
For more detailed information on log rotation schedules and storage limits for various log types, refer to the [documentation on Server log retention](./concepts-monitoring.md#server-logs).
72+
73+
74+
## Frequently asked questions
75+
76+
*Question*: My error logs contain the note as shown, what does this mean?
77+
78+
`[Note] [Server] Access denied for user ''@'xx.xx.xx.X' (using password: NO).`
79+
80+
*Answer*: This note indicates that an attempt to connect to your MySQL server was unsuccessful due to incorrect or missing authentication details. Specifically, the username provided is empty(''@'xx.xx.xx.X') and no password was entered (using password: NO). This note could indicate an unauthorized attempt to access your database.
81+
If your server is publicly accessible, it remains exposed to the internet and can be a target for unauthorized access attempts. To enhance the security of your Azure Database for MySQL flexible server, [disable public access](./concepts-networking-private-link.md#deny-public-access) or [limit access using firewall rules.](./concepts-networking-public.md#firewall-rules).
82+
83+
## Next steps
84+
- How to enable server logs feature via Azure portal. [Learn more](./how-to-server-logs-portal.md)
85+
- How to enable server logs feature via Azure CLI. [Learn more](./how-to-server-logs-cli.md)

articles/mysql/flexible-server/concepts-monitoring.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.date: 9/21/2020
1515

1616
Azure Database for MySQL - Flexible Server provides monitoring of servers through Azure Monitor. Monitoring data about your servers helps you troubleshoot and optimize for your workload.
1717

18-
In this article, you'll learn about the various metrics available and Server logs for your flexible server that give insight into the behavior of your server.
18+
In this article, you learn about the various metrics available and Server logs for your flexible server that give insight into the behavior of your server.
1919

2020
> [!NOTE]
2121
> This article contains references to the term *slave*, a term that Microsoft no longer uses. When the term is removed from the software, we'll remove it from this article.
@@ -42,7 +42,7 @@ These metrics are available for Azure Database for MySQL:
4242
|Active Connections|active_connection|Count|The number of active connections to the server. Active connections are the total number of [threads connected](https://dev.mysql.com/doc/refman/8.0/en/server-status-variables.html#statvar_Threads_connected) to your server, which also includes threads from [azure_superuser](../single-server/how-to-create-users.md).|
4343
|Storage IO percent|io_consumption_percent|Percent|The percentage of IO in use over selected period. IO percent is for both read and write IOPS.|
4444
|Storage IO Count|storage_io_count|Count|The total count of I/O operations (both read and write) utilized by server per minute.|
45-
|Host Memory Percent|memory_percent|Percent|The total percentage of memory in use on the server, including memory utilization from both database workload and other Azure MySQL processes. This metric provides evaluation of the server's memory utilization, excluding re-usable memory like buffer and cache.|
45+
|Host Memory Percent|memory_percent|Percent|The total percentage of memory in use on the server, including memory utilization from both database workload and other Azure MySQL processes. This metric provides evaluation of the server's memory utilization, excluding reusable memory like buffer and cache.|
4646
|Available Memory Bytes|available_memory_bytes|Bytes|This metric represents the amount of memory that is currently available for use on the server.|
4747
|Total connections|total_connections|Count|The number of client connections to your Azure Database for MySQL - Flexible Server. Total Connections is sum of connections by clients using TCP/IP protocol over a selected period.|
4848
|Aborted Connections|aborted_connections|Count|Total number of failed attempts to connect to your MySQL server, for example, failed connection due to bad credentials. For more information on aborted connections, you can refer to this [documentation](https://dev.mysql.com/doc/refman/5.7/en/communication-errors.html).|
@@ -107,7 +107,7 @@ These metrics are available for Azure Database for MySQL:
107107
|Metric display name|Metric|Unit|Description|
108108
|---|---|---|---|
109109
|InnoDB Row Lock Time|innodb_row_lock_time|Milliseconds|InnoDB row lock time measures the duration of time in milliseconds for InnoDB row-level locks.|
110-
|InnoDB Row Lock Waitss|innodb_row_lock_waits|Count|InnoDB row lock waits count the number of times a query had to wait for an InnoDB row-level lock.|
110+
|InnoDB Row Lock Waits|innodb_row_lock_waits|Count|InnoDB row lock waits count the number of times a query had to wait for an InnoDB row-level lock.|
111111
|Innodb_buffer_pool_reads|Innodb_buffer_pool_reads|Count|The total count of logical reads that InnoDB engine couldn't satisfy from the Innodb buffer pool, and had to be fetched from the disk.|
112112
|Innodb_buffer_pool_read_requests|Innodb_buffer_pool_read_requests|Count|The total count of logical read requests to read from the Innodb Buffer pool.|
113113
|Innodb_buffer_pool_pages_free|Innodb_buffer_pool_pages_free|Count|The total count of free pages in InnoDB buffer pool.|
@@ -119,16 +119,16 @@ These metrics are available for Azure Database for MySQL:
119119
## Server logs
120120

121121
In Azure Database for MySQL Server – Flexible Server, users can configure and download server logs to assist with troubleshooting efforts. With this feature enabled, a flexible server starts capturing events of the selected log type and writes them to a file. You can then use the Azure portal and Azure CLI to download the files to work with them.
122-
The server logs feature is disabled by default. For information about how to enable server logs, see [How to enable and download server logs for Azure Database for MySQL - Flexible Server](./how-to-server-logs-portal.md)
122+
The server logs feature is disabled by default. For information about how to enable server logs, see [How to enable and download server logs for Azure Database for MySQL - Flexible Server.](./how-to-server-logs-portal.md)
123123

124+
Server logs support [slow query logs](./concepts-slow-query-logs.md) and [error logs](./concepts-error-logs.md) for enabling and downloading.
124125
To perform a historical analysis of your data, in the Azure portal, on the Diagnostics settings pane for your server, add a diagnostic setting to send the logs to Log Analytics workspace, Azure Storage, or event hubs. For more information, see [Set up diagnostics](./tutorial-query-performance-insights.md#set-up-diagnostics).
125126

126127
**Server logs retention**
127128

128-
When logging is enabled for an Azure Database for MySQL - Flexible Server, logs are available up to seven days from their creation.
129-
If the total size of the available logs exceeds 7 GB, then the oldest files are deleted until space is available.
129+
When logging is enabled for an Azure Database for MySQL - Flexible Server, all the logs, *including error logs and slow query logs* are available up to seven days from their creation. If the total size of all the available logs exceeds 7 GB, then the oldest files are deleted until space is available.
130130
The 7-GB storage limit for server logs is available free of cost and can't be extended.
131-
Logs are rotated every 24 hours or 7 GB, whichever comes first.
131+
Logs are rotated every 24 hours or 500 MB, whichever comes first.
132132

133133

134134
## Next steps
39.4 KB
Loading
104 KB
Loading
64.4 KB
Loading

articles/mysql/flexible-server/overview.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ You have two networking options to connect to your Azure Database for MySQL - Fl
8080

8181
- **Private access (VNet Integration)** – You can deploy your flexible server into your [Azure Virtual Network](../../virtual-network/virtual-networks-overview.md). Azure virtual networks provide private and secure network communication. Resources in a virtual network can communicate through private IP addresses.
8282

83-
Choose the VNet Integration option if you want the following capabilities:
83+
Choose the virtual network Integration option if you want the following capabilities:
8484

8585
- Connect from Azure resources in the same virtual network to your flexible server using private IP addresses
8686
- Use VPN or ExpressRoute to connect from non-Azure resources to your flexible server
@@ -106,11 +106,11 @@ The read replica feature allows you to replicate data from an Azure Database for
106106

107107
For more information, see [Read Replica concepts](concepts-read-replicas.md).
108108

109-
## Setup Hybrid or Multi-Cloud Data synchronization with Data-in replication
109+
## Setup Hybrid or multicloud Data synchronization with Data-in replication
110110

111111
Data-in replication allows you to synchronize data from an external MySQL server into the Azure Database for MySQL Flexible Server. The external server can be on-premises, in virtual machines, Azure Database for MySQL Single Server, or a database service hosted by other cloud providers. Data-in replication is based on the binary log (binlog) file position-based. The main scenarios to consider about using Data-in replication are:
112112
* Hybrid Data Synchronization
113-
* Multi-Cloud Synchronization
113+
* Multicloud Synchronization
114114
* [Minimal downtime migration to Flexible Server](../../mysql/howto-migrate-single-flexible-minimum-downtime.md)
115115

116116
For more information, see [Data-in replication concepts](concepts-data-in-replication.md).
@@ -185,6 +185,7 @@ One advantage of running your workload in Azure is its global reach. The flexibl
185185
| France Central | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
186186
| France South | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: |
187187
| Germany West Central | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: |
188+
| Israel Central | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: |
188189
| Japan East | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
189190
| Japan West | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: |
190191
| Korea Central | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
@@ -194,7 +195,7 @@ One advantage of running your workload in Azure is its global reach. The flexibl
194195
| Norway East | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: |
195196
| Norway West | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: |
196197
| Qatar Central | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: |
197-
| South Africa North | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: |
198+
| South Africa North | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: |
198199
| South Central US | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
199200
| South India | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: |
200201
| Southeast Asia | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |

0 commit comments

Comments
 (0)