mac apache 日志_Mac OS X中的Apache日志文件并进行分析

本文介绍了如何在Mac OS X上查看和分析Apache日志。默认情况下,Apache日志存储在/private/var/log/apache2目录下,包括访问日志和错误日志。访问日志记录所有请求,包括IP、时间、HTTP方法、资源和响应大小,而错误日志则包含错误信息和引起错误的资源。在Windows上有Apache Log Viewer这样的工具来帮助查看日志,但在Mac OS X上没有内置应用。
摘要由CSDN通过智能技术生成

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)中配置的日志文件有两种类型:

  1. 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响应代码和响应的大小。 如果您拥有自己的虚拟主机,则最好配置其访问日志文件。

  2. 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 日志

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值