Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk10 min

How to Configure HAProxy Logging With Rsyslog on a Linux Server

Learn how HAProxy hands logs to rsyslog, configure /dev/log or UDP 514, route local0 to a dedicated file, handle chroot paths, and troubleshoot missing or duplicate entries.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

HAProxy does not create log files itself. It sends log messages to a syslog daemon, such as rsyslog, which then writes those messages to a file, the system journal, or another destination. A reliable setup therefore has three matching parts: an HAProxy log directive, an rsyslog input, and an rsyslog rule that routes the local0 facility to a dedicated file.

The usual local configuration sends HAProxy to the Unix socket at /dev/log. If you need a network-style endpoint instead, send to UDP loopback on port 514 and enable rsyslog’s UDP input. The steps below cover both designs, chrooted HAProxy installations, safe validation, and the failure modes that most often leave /var/log/haproxy.log empty.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How HAProxy logging works

HAProxy’s logging architecture is different from an application that opens and writes its own file. The HAProxy management documentation states: “For logging, HAProxy always relies on a syslog server since it does not perform any file-system access.” HAProxy formats a message and hands it to a syslog receiver; rsyslog decides where that message is stored.

That division explains most configuration problems. A syntactically valid HAProxy configuration can still produce no file if rsyslog is not listening on the selected endpoint, if the facility does not match, or if a chroot hides the socket. Conversely, an rsyslog rule can be correct but receive nothing when HAProxy never enables logging for the relevant defaults, frontend, or backend.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

The three values that must agree

  • Transport and endpoint: HAProxy must send to the exact Unix socket or UDP address and port that rsyslog listens on.
  • Facility: The examples use local0 in both HAProxy and rsyslog.
  • Routing rule: rsyslog needs a rule such as local0.* /var/log/haproxy.log and permission to create or append to the destination.

On Linux, the GNU C library normally sends local syslog messages to a Unix socket at /dev/log. That is why HAProxy documentation recommends a /dev/log local0 directive for a local daemon.

Before changing either service

Package layouts and service managers differ between distributions. Start by identifying the files and service names used by the host rather than copying a path blindly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Check the installed versions of HAProxy and rsyslog with the package manager or each program’s version option.
  2. Locate the active HAProxy configuration, commonly a file under /etc/haproxy/, and identify any chroot directive in its global section.
  3. Locate the active rsyslog configuration. It may be a main file under /etc/rsyslog.conf, a drop-in directory, or a distribution-specific include path.
  4. Determine whether the host uses rsyslog, systemd-journald alone, or both. If rsyslog is not running, an rsyslog file rule cannot receive messages until the daemon is installed and active.
  5. Choose one receiver path for the first deployment. Mixing a Unix socket and UDP endpoint makes troubleshooting harder unless you deliberately need two destinations.

Keep a backup of the working configuration and make one transport change at a time. The service commands shown below use systemd syntax as an example; use the equivalent service manager commands on another init system.

Choose between /dev/log and UDP loopback

Both transports can work on one server, but their operational behavior differs. Select the one that fits the host’s socket layout and restart policy.

Characteristic Unix socket (/dev/log) UDP loopback (for example, 127.0.0.1:514)
Network exposure No network listener is required; communication stays on the local filesystem socket. Can be bound to loopback so it is not exposed externally, but rsyslog still has a UDP listener to manage.
HAProxy endpoint log /dev/log local0 log 127.0.0.1:514 local0
Rsyslog requirement The local Unix-socket input must be active. The imudp module must be loaded and bound to the selected address and port.
Reliability characteristics Avoids network packet delivery, but the socket lifecycle matters. Replacing the socket while HAProxy runs can stop delivery. Simple to observe with socket tools, but UDP has listener, firewall, and packet-delivery considerations.
Chroot behavior The socket must also exist inside HAProxy’s chroot. No Unix socket path is needed inside the chroot, although the UDP endpoint must remain reachable from it.
Troubleshooting Check the path and permissions visible to HAProxy and rsyslog. Check module loading, bind address, port 514, and local firewall policy.
Restart behavior After rsyslog replaces the socket, HAProxy may need a reload or restart. The listener can be managed independently, but HAProxy still needs a reachable receiver.

For a conventional single-host installation, start with /dev/log. Use UDP when you specifically need a non-Unix endpoint, when the socket path cannot be shared with a chroot, or when your operational tooling is built around a UDP listener.

Configure HAProxy to emit local0 messages

Recommended Unix-socket configuration

Add one log directive to the global section of the active HAProxy configuration:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
global
    log /dev/log local0

defaults
    log global
    mode http
    option httplog

log /dev/log local0 selects the receiver and the syslog facility. log global tells the defaults section to inherit that global logging destination. option httplog selects HAProxy’s HTTP log format for HTTP traffic; use the logging option appropriate to the protocol and HAProxy configuration you operate.

If a particular frontend or backend does not inherit the relevant defaults, add the logging directive explicitly in that section according to your existing configuration structure. Do not add multiple destinations merely to make a missing message reappear; first verify inheritance and the receiver.

UDP loopback configuration

When using a non-Unix local receiver, replace the global endpoint with the loopback address and port:

global
    log 127.0.0.1:514 local0

defaults
    log global

Keep the address local unless another host genuinely needs to receive these messages. Binding to loopback limits exposure and avoids creating an unnecessary remote syslog service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Facility and severity notation

The examples use the local0 facility. In rsyslog, local0.* means every severity sent with that facility. If you change HAProxy to another local facility, change the rsyslog selector to the same value; a mismatch is enough to produce an empty destination file.

Route Unix-socket messages with rsyslog

Most Linux packages configure rsyslog’s local input for /dev/log by default, but verify that the input is enabled in the active configuration. Add a dedicated rule in the appropriate rsyslog configuration file or drop-in:

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
local0.*    /var/log/haproxy.log
& stop

The first line writes all local0 messages to /var/log/haproxy.log. The legacy & stop action prevents those messages from continuing into later rules on rsyslog versions that support this syntax, which helps avoid duplicate entries in a general system log. Confirm the syntax supported by the rsyslog version installed on the server before deploying it; newer configurations may use a different stop expression.

Make sure the parent directory exists and that rsyslog can create or append to the file. If your distribution uses a different log directory, use that path consistently in the rule and in your verification commands. Do not assume that a file’s absence means rsyslog is inactive: the rule may be loaded only after a service reload, and the destination directory may not exist.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When the local socket input is not active

If rsyslog is installed but no local socket input is configured, enable the package’s supported Unix-socket input for /dev/log. Distribution defaults vary, so use the existing rsyslog configuration style rather than combining incompatible module syntaxes. After enabling it, reload or restart rsyslog, then reload HAProxy if the socket was created or replaced.

Configure rsyslog for UDP port 514

UDP logging requires rsyslog to load the imudp input module and listen on the same address and port HAProxy uses. The following is the legacy syntax documented for HAProxy integrations:

$ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514

Place these directives in the active rsyslog configuration before the routing rule, or use the equivalent modern module syntax supported by the installed rsyslog release. Binding to 127.0.0.1 keeps the listener local. If you intentionally bind another address, account for firewall policy and the security implications of accepting syslog packets there.

Use the same dedicated rule after the input configuration:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
local0.*    /var/log/haproxy.log
& stop

Port 514 is a conventional syslog port, not a guarantee that it is available. Check for another process already bound to it and ensure the host’s local firewall permits the loopback traffic. A listener on the wrong address will not receive packets sent to a different address even when both use port 514.

Handle HAProxy chroot correctly

A chroot changes the filesystem view available to HAProxy. If HAProxy is chrooted, its /dev/log is not automatically the host’s /dev/log; rsyslog must create a socket inside the chroot directory.

For example, if the configured chroot directory is /var/lib/haproxy, an rsyslog addition commonly looks like this:

$AddUnixListenSocket /var/lib/haproxy/dev/log

Use the actual chroot path from the HAProxy configuration, not this example path unless it matches your host. Create the dev directory inside that chroot, set ownership and permissions according to the distribution’s HAProxy package, and ensure rsyslog can create its socket there. The path in HAProxy’s log directive must match the path as seen from inside the chroot.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

After adding the socket, restart or reload rsyslog as required by the package, then reload or restart HAProxy. A common symptom of a missing chroot socket is that host-level rsyslog appears healthy while HAProxy logs remain silent.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Validate and apply the configuration safely

Validate each daemon before asking it to serve traffic. Exact service names and command-line options can differ by distribution, so substitute the paths used by your installation.

  1. Check HAProxy syntax. Run the installed binary’s configuration check against the active file, for example sudo haproxy -c -f /etc/haproxy/haproxy.cfg. Continue only when the check reports success.
  2. Check rsyslog syntax. Use the validation method documented by your distribution. On systems that support it, sudo rsyslogd -N1 performs a configuration parse without starting a second daemon.
  3. Reload rsyslog. Use the host’s service manager, such as sudo systemctl reload rsyslog. If the package does not support a safe reload or a new socket must be created, restart it instead.
  4. Reload HAProxy. Use the package’s supported reload command after rsyslog is ready. A reload preserves existing connections when configured correctly; a restart has a larger service impact.
  5. Confirm the destination. Check that the parent directory exists, the file is writable by rsyslog, and no mandatory access-control policy is blocking writes.
  6. Generate real traffic. Send a request through the HAProxy frontend rather than relying on a configuration check. Logging is generated when the configured traffic path handles a request.
  7. Inspect the file. Follow the destination with a command such as sudo tail -f /var/log/haproxy.log, then make another request. Confirm that the message carries the expected facility and program tag.

Keep the test request specific to the frontend you changed. A request sent directly to a backend or to a different listener will not prove that the intended HAProxy section is logging.

Troubleshoot an empty or incomplete log

Symptom Checks Correction
No file output at all Confirm the rsyslog rule is loaded, the destination directory exists, and both services use local0. Fix the selector or path, reload rsyslog, reload HAProxy, and generate a request through the configured frontend.
HAProxy starts but no messages arrive over UDP Verify that imudp is loaded, rsyslog listens on the selected address and port, and local firewall policy permits the traffic. Correct the bind address or port, enable the input module, and reload rsyslog before testing again.
Unix-socket path is silent Compare HAProxy’s socket path with rsyslog’s listening path. If chroot is enabled, check the path inside the chroot. Create the in-chroot socket with the correct directory permissions and reload both daemons.
Messages appear in more than one log Inspect later rsyslog rules and distribution defaults that also route local0. Place the dedicated file rule in the intended order and add the supported stop or discard action after it.
Logging stops after rsyslog restarts Check whether rsyslog replaced the Unix socket while HAProxy continued running. Reload or restart HAProxy after the socket replacement, or use a network endpoint whose listener lifecycle is managed separately.
The file exists but remains empty Confirm that the tested traffic reaches the logging-enabled frontend, that log global is inherited, and that the selected log option applies to the protocol. Correct the HAProxy section inheritance or logging option, then retest with a real request.
Rsyslog reports a permission or open-file error Check destination-directory ownership, file mode, and any host security policy that governs daemon writes. Adjust permissions using the distribution’s package conventions; do not make the log directory world-writable.

Prevent recurrence in production

Keep one authoritative transport

Document whether the host uses /dev/log or UDP and record the exact address, port, facility, chroot directory, and destination file. Future package updates are less likely to break logging when operators can compare those values directly.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Reload in dependency order

When using a Unix socket, bring rsyslog’s socket back first and then reload HAProxy. This order ensures that HAProxy reconnects to the receiver after a socket replacement. If a service manager’s reload operation does not recreate the required socket, use the package-supported restart procedure and account for its availability impact.

Watch for duplicates without hiding failures

A stop or discard action is useful when you want a dedicated file without copies in a general system log, but it can also make a routing mistake less visible. Verify the dedicated file before suppressing later rules, and retain the facility and program information needed for incident analysis.

Test after package or policy changes

Re-run the HAProxy and rsyslog syntax checks after upgrades, then send a real request through the frontend and inspect the destination. Changes to chroot directories, socket permissions, firewall policy, or rsyslog module defaults can alter logging even when the HAProxy file itself was not edited.

A compact working example

The following pair shows the complete local-socket pattern in one place. Adapt file locations, service commands, permissions, and the active rsyslog include path to the distribution.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
# /etc/haproxy/haproxy.cfg
global
    log /dev/log local0

defaults
    log global
    mode http
    option httplog
# rsyslog drop-in
local0.*    /var/log/haproxy.log
& stop

For UDP loopback, replace the HAProxy global line with log 127.0.0.1:514 local0 and add the supported imudp configuration with 127.0.0.1 and port 514 before the same routing rule. Then validate both configurations, reload rsyslog, reload HAProxy, send a request through the frontend, and inspect the configured file.

What a successful result looks like

A successful setup has an active HAProxy log destination, an rsyslog listener on that exact endpoint, and a loaded rule that selects local0. After a request reaches the logging-enabled frontend, a new line appears in the dedicated file with the expected HAProxy program information. If any one of those three links is missing, the file can remain empty even though each daemon appears to be running.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.