OPNsense Forum

Archive => 21.7 Legacy Series => Topic started by: Joop on August 18, 2021, 02:39:55 pm

Title: HAProxy plugin / File based Log (non-Circular)
Post by: Joop on August 18, 2021, 02:39:55 pm
I have switched my logging to file based logging and it looks like only the log of HAProxy isn't working as it did before the switch.
Before the switched it logged all connections and its info but now it only logs the start and stop events when the service stops and starts. There is definitely traffic going through it!

Versions of the software:
OPNsense 21.7.1-amd64
FreeBSD 12.1-RELEASE-p19-HBSD
OpenSSL 1.1.1k 25 Mar 2021
os-haproxy   3.4

HAProxy config (partly)

#
# Automatically generated configuration.
# Do not edit this file manually.
#

global
    uid                         80
    gid                         80
    chroot                      /var/haproxy
    daemon
    stats                       socket /var/run/haproxy.socket group proxy mode 775 level admin expose-fd listeners
    nbproc                      1
    tune.ssl.default-dh-param   1024
    spread-checks               0
    tune.chksize                16384
    tune.bufsize                16384
    tune.lua.maxmem             0
    log 127.0.0.1:514 local0 info

defaults
    log     global
    option redispatch -1
    timeout client 30s
    timeout connect 30s
    timeout server 30s
    retries 3
    default-server init-addr libc,last

# Frontend: HTTPS_Frontend (std https)
frontend HTTPS_Frontend
    bind 0.0.0.0:443 name 0.0.0.0:443 ssl  crt-list /tmp/haproxy/ssl/5f32b8a9732706.90097643.certlist
    mode http
    option http-keep-alive
    option forwardfor
    # tuning options
    timeout client 300s

    # logging options
    option log-separate-errors
    option httplog
    option socket-stats
    # ACL: 00_find_acme_challenge
    acl acl_5f2fe4314a20f9.52229989 path_beg -i /.well-known/acme-challenge/

I followed the advice to save the logging settings first before use Clear log data but still no extended logs from HAProxy

What am I missing?

Regards,

Joop
Title: Re: HAProxy plugin / File based Log (non-Circular)
Post by: Joop on September 12, 2021, 03:44:32 pm
I had time to look at my own post and since posting I have updated opnsense to the latest release and thus also haproxy.

After adding a secondary log target and playing around I have logs again for haproxy but I'm back to using circular logs for that.
What also changed, but that might be because of circular logs, is that haproxy config now has the following statement:
log /var/run/log local0 debug

While it logged to 127.0.0.1:514 in my initial post.