HAProxy Log 日志系统详解

HAProxy Log 日志系统详解1、实验拓扑2、相关配置博客参照以下链接3、日志系统介绍4、日志的前提配置参照以下博客5、HAProxy 的原始日志格式6、Chromy 进行访问时报头守护7、HAProxy 的 cfg 文件修改8、HAProxy 的日志格式(已经捕捉到新的报文守护)1、实验拓扑2、相关配置博客参照以下链接HAProxy Balance 调度算法详解(包括 hash t...
摘要由CSDN通过智能技术生成

1、实验拓扑

在这里插入图片描述

2、相关配置博客参照以下链接

HAProxy Balance 调度算法详解(包括 hash type)

HAProxy 的 server 参数、 stats 相关参数和 cookie 参数详解(包含其它相关参数 rspadd / rspdel / option / mode / maxconn )

3、日志系统介绍

## log global                                                       # 采用全局 log 配置
## log <address> [len <length>] <facility> [<level> [<minlevel>]]   # 自定义 log
## no log                                                           # 不记录 log
						
## 注意:默认发往本机的日志服务器
	## (1) local2.*      /var/log/local2.log 
	## (2) $ModLoad imudp
		   $UDPServerRun 514

常用的一些日志命令:								
	## log-format <string>
						
	## capture cookie <name> len <length>
		Capture and log a cookie in the request and in the response.
		
	## capture request header <name> len <length> 
		Capture and log the last occurrence of the specified request header.
		## 示例: capture request header X-Forwarded-For len 15
						
	## capture response header <name> len <length>
		Capture and log the last occurrence of the specified response header.
		## 示例 :capture response header Content-length len 9
		## 示例: capture response header Location len 15		

4、日志的前提配置参照以下博客

HAProxy 简单示例及 HAProxy_Log 的简单配置

5、HAProxy 的原始日志格式

[root@Tang ~]# tail -6 /var/log/haproxy/haproxy.log 
Nov  8 11:10:03 neo haproxy[5165]: 172.16.141.99:65301 [08/Nov/2019:11:10:03.031] web websrvs/srv1 7/0/1/1/9 304 142 - - ---- 2/2/0/0/0 0/0 "GET / HTTP/1.1"
Nov  8 11:10:08 neo haproxy[5165]: 172.16.141.99:65309 [08/Nov/2019:11:10:08.916] web websrvs/srv2 1/0/
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值