在ubuntu 16.04中没有创建Haproxy日志

问题描述 投票:0回答:1

使用相同的配置,haproxy日志记录在ubuntu 14.04的/var/log/haproxy.log中,但是当移动到ubuntu 16.04时,它失败了。我检查了https://serverfault.com/questions/738501/how-to-fix-simple-haproxy-logging/738508https://serverfault.com/questions/488967/haproxy-not-logging中提到的不同的东西。

似乎没什么用。无法找到修复是否是由于ubuntu 16.04中进行的系统更改。

haproxy.cfg有:

global
    chroot /var/lib/haproxy
    log /dev/log  local0
    log /dev/log  local1 notice

defaults
    log global

/etc/R syslog.的/49-哈proxy.conf :

# Create an additional socket in haproxy's chroot in order to allow logging via
# /dev/log to chroot'ed HAProxy processes
$AddUnixListenSocket /var/lib/haproxy/dev/log

# Send HAProxy messages to a dedicated logfile
if $programname startswith 'haproxy' then /var/log/haproxy.log
&~
logging ubuntu-16.04 haproxy
1个回答
1
投票

我挣扎着我怀疑是同样的问题。我期待在/var/log/haproxy.log中找到HTTP访问日志。这是我如何解决我的问题以及我发现的问题。

前端记录

要记录HTTP请求,我有以下配置:

default
  mode http
  option  httplog
  option  dontlognull

frontend www-http
  bind *:80
  log /dev/log local0

需要在前端设置log指令以获取HTTP访问日志。

dontlognull选项对于过滤掉TCP探测非常有用。

全球伐木

全局配置标题下的log指令用于系统错误,启动/停止等。(more info

© www.soinside.com 2019 - 2024. All rights reserved.