Home > Database > Mysql Tutorial > body text

How to check the logs of IIS, PHP and MySQL

WBOY
Release: 2023-06-02 16:57:32
forward
2008 people have browsed it

1. IIS log

  1. Open IIS, find the website, right-click and select "Properties" and find the "Website Home Directory" option Card.

  2. In the "Log file" column, select "Daily" or "Maximum file" as the log method.

  3. To view the log, you can view the path of the log file in "Website Properties" - "Log File".

2. PHP log

You can use the following function to open the error log in PHP:

ini_set('error_log', 'C:/path/to/php-error.log');  // 将错误日志打印到指定文件中
ini_set('log_errors', true);  // 开启错误日志
error_reporting(-1);  // 输出所有错误信息
Copy after login

It is recommended to Error logs are printed to separate files for easier viewing. To view the error log, you can directly open it through the file path.

3. MySQL logs

MySQL logs are divided into error logs, warning logs, slow query logs and binary logs. They can be enabled through the following command line operations:

  1. Error log:

Add the following configuration to the MySQL configuration file to enable the error log:

log_error=/path/to/mysql-error.log
Copy after login

Among them /path/to/mysql-error.log is the error log path.

  1. Warning log:

Add the following configuration to the MySQL configuration file to enable the warning log:

log_warnings=2
Copy after login

where2 is the warning level.

  1. Slow query log:

Add the following configuration to the MySQL configuration file to enable the slow query log:

slow_query_log=1
slow_query_log_file=/path/to/mysql-slow.log
Copy after login

Among them /path/to/mysql-slow.log is the slow query log path.

  1. Binary log:

Add the following configuration to the MySQL configuration file to enable binary log:

log-bin=/path/to/mysql-bin
Copy after login

where/path/to/mysql-bin is the binary log path.

The above is the detailed content of How to check the logs of IIS, PHP and MySQL. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template