Rechercher

Ce contenu n'est pas disponible dans la langue sélectionnée.

5.7. Logging HAProxy Messages to rsyslog

download PDF
You can configure your system to log HAProxy messages to rsyslog by writing to the /dev/log socket. Alternately you can target the TCP loopback address, however this results in slower performance.
The following procedure configures HAProxy to log messages to rsyslog.
  1. In the global section of the HAProxy configuration file, use the log directive to target the /dev/log socket.
    log /dev/log local0
    
  2. Update the frontend, backend, and listen proxies to send messages to the rsyslog service you configured in the global section of the HAProxy configuration file. To do this, add a log global directive to the defaults section of the configuration file, as shown.
    defaults
        log global
        option httplog
    
  3. If you are running HAProxy within a chrooted environment, or you let HAProxy create a chroot directory for you by using the chroot configuration directive, then the socket must be made available within that chroot directory. You can do this by modifying the rsyslog configuration to create a new listening socket within the chroot filesystem. To do this, add the following lines to your rsyslog configuration file.
    $ModLoad imuxsock
    $AddUnixListenSocket PATH_TO_CHROOT/dev/log
    
  4. To customize what and where HAProxy log messages will appear, you can use rsyslog filters as described in Basic Configuration of Rsyslog in the System Administrator's Guide.
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.