mac apache 日志
In last article, we saw how to install Apache on Mac OS X, today we will learn some basic things about apache logs in Mac OS X.
在上一篇文章中,我们了解了如何在Mac OS X上安装Apache ,今天我们将学习有关Mac OS X中apache日志的一些基本知识。
By default apache logs are present in /private/var/log/apache2/
directory and you can access it with root user. There are two types of log files configured in apache configuration file (httpd.conf) which are;
默认情况下,Apache日志位于/private/var/log/apache2/
目录中,您可以用root用户访问。 在apache配置文件(httpd.conf)中配置的日志文件有两种类型:
- Access Log – This file contains all the requests made to the Apache server. Its configured in httpd.conf as
CustomLog “/private/var/log/apache2/access_log” common
The access log file contains Requester IP, time of the request, HTTP method (GET, POST etc.), the resource requested, HTTP response code and the size of the response. If you are having your own virtual host, then its always better to configure its access logs file.
CustomLog“ / private / var / log / apache2 / access_log”常见访问日志文件包含请求者IP,请求时间,HTTP方法(GET,POST等),请求的资源,HTTP响应代码和响应的大小。 如果您拥有自己的虚拟主机,则最好配置其访问日志文件。
- Error Log – This file contains the error logs for any request made to the Apache server. The default file is configured in httpd.conf as
ErrorLog “/private/var/log/apache2/error_log”
This file entry contains requester IP, type of error, error information and the resource which is causing the error.
错误日志“ / private / var / log / apache2 / error_log”该文件条目包含请求者IP,错误类型,错误信息以及导致错误的资源。
There is no application in Mac OS X for better viewing of apache logs but if you are on Windows, you can try Apache Log Viewer.
Mac OS X中没有应用程序可以更好地查看apache日志,但是如果您使用的是Windows,则可以尝试Apache Log Viewer 。
翻译自: https://www.journaldev.com/1468/apache-log-files-in-mac-os-x-and-analyzing-it
mac apache 日志