VincentSaelzler / hyper-homelab

A foray into hyper-converged architecture.
GNU General Public License v3.0
0 stars 0 forks source link

log requests to haproxy #168

Closed VincentSaelzler closed 2 years ago

VincentSaelzler commented 2 years ago

followed tutorial: https://www.haproxy.com/blog/introduction-to-haproxy-logging/

so far the setup kind of works, but not exactly as anticipated.

the logs all go to var/log/haproxy.log instead of being split between /var/log/haproxy-traffic.log and /var/log/haproxy-admin.log

i think it is because somehow a file got auto-created in /etc/rsyslog.d

VincentSaelzler commented 2 years ago

no additional logging stuff required for now. the default contents of 49-haproxy.conf are fine.

# 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
:programname, startswith, "haproxy" {
  /var/log/haproxy.log
  stop
}
VincentSaelzler commented 2 years ago

still leaves the task of deleting the extra files i made using the haproxy tutorial.

i will keep this ticket open and hold off on doing that until i can be sure that the base logging is good enough.

VincentSaelzler commented 2 years ago

take that back - without copying the additional file, the default contents of 49-haproxy.conf do not show any of the traffic

VincentSaelzler commented 2 years ago

base logging config is basically good! just need to remove the stop command:

    - name: Modify the Default HAProxy Config (Defaults to ONLY Sending Logs to Local File)
      lineinfile:
        path: /etc/rsyslog.d/49-haproxy.conf
        line: '# stop # commenting so rsyslog will also send to other destinations'
        regexp: "^  stop$"
        state: present