Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
VGSources
Blog

How to Configure HAProxy Logging With Rsyslog on a Linux Server

A practical guide to routing HAProxy logs through rsyslog on Linux, with working /dev/log and UDP configurations, chroot handling, validation steps, and fixes for missing or duplicate entries.
Length10 min Posted Quest giverVGSources Team
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 receiver, and rsyslog writes those messages to disk. A reliable local setup is to send facility local0 to /dev/log, enable global logging in HAProxy, route local0.* to a dedicated file, then validate both daemons and generate a real request.

Understand the HAProxy-to-rsyslog path

The logging chain has three separate components: HAProxy produces a syslog message, a receiver accepts it, and rsyslog applies a rule that writes it somewhere. HAProxy Technologies states in its management documentation: “For logging, HAProxy always relies on a syslog server since it does not perform any file-system access.” Therefore, changing a file path in HAProxy cannot make file logging work; the receiver and its routing rules must be correct.

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.

The normal local flow is:

  1. HAProxy selects a syslog endpoint and facility in its global section.
  2. The defaults section, or an individual frontend or backend, enables logging for the proxies that should emit messages.
  3. Rsyslog receives the message through a UNIX socket such as /dev/log or through UDP.
  4. An rsyslog selector matching the local0 facility writes the message to a dedicated file.

The facility is the routing key. If HAProxy sends with local0 but rsyslog matches another facility, the file remains empty even though both services are running.

Choose a receiver: /dev/log or UDP loopback

Both transports are valid. Pick one endpoint and make the HAProxy and rsyslog settings identical rather than configuring both accidentally.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Characteristic UNIX socket (/dev/log) UDP loopback (127.0.0.1:514)
HAProxy setting log /dev/log local0 log 127.0.0.1:514 local0
Receiver requirement Rsyslog must have a local UNIX-socket input at the exact path Rsyslog must load imudp and listen on the selected address and port
Network exposure No network listener or firewall rule Bind to loopback when only local HAProxy logging is required
Delivery behavior Avoids network packet handling, but depends on socket-path visibility Simple to observe with socket tools, but UDP can be lost and requires a listener
Chroot impact The socket must also exist inside HAProxy’s chroot The endpoint is outside the chroot, but the HAProxy process still needs network access to it
Restart behavior Replacing the socket while HAProxy runs can stop messages until HAProxy is reloaded or restarted The listener lifecycle is separate from the socket path, although rsyslog availability still matters

For a single host with a standard package layout, /dev/log is usually the shortest configuration. UDP loopback is useful when a local UNIX socket is unavailable or when you specifically need a network-style receiver. Do not bind UDP to all interfaces unless remote senders are intentional and the host firewall and access policy have been designed for them.

Check the host before changing configuration

Distribution packages differ in file locations, service names, default inputs, and whether systemd-journald participates in the path. Establish the local facts first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Record the installed HAProxy and rsyslog versions.
  • Locate the active HAProxy configuration and the rsyslog configuration directory or drop-in directory used by the service manager.
  • Determine whether the host uses rsyslog directly, systemd-journald forwarding, or both.
  • Inspect the HAProxy global section for an existing log directive, a chroot directive, and any existing user or group restrictions.
  • Check that the directory intended for the log file exists and that the rsyslog service can create or append to the file.
  • Decide whether messages should also remain in the general system log. This affects whether you add a stop or discard action after the dedicated file action.

Do not add a second competing log line simply because an example uses a different transport. Remove or edit the obsolete endpoint so that the active configuration has one deliberate path.

Configure HAProxy to emit messages

Recommended local UNIX-socket configuration

Add the endpoint and facility in the global section, then enable the global logging policy in defaults:

global
    log /dev/log local0

defaults
    log global
    mode http
    option httplog

HAProxy documentation recommends the /dev/log local0 pattern for the local daemon, and Red Hat documents the same form. The log global line makes the endpoint defined in global available to the proxy sections inheriting defaults. option httplog selects the HTTP log format; it is appropriate for HTTP frontends, while TCP-only configurations should use the logging options appropriate to their mode.

UDP loopback configuration

If you choose UDP rather than a UNIX socket, change the global endpoint to the loopback address and port:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
global
    log 127.0.0.1:514 local0

defaults
    log global

The port is the conventional syslog UDP port. Use the same address and port in rsyslog; 127.0.0.1 is deliberately narrower than a wildcard address.

Enable logging only where it is needed

A log global line under defaults applies to inheriting frontends and backends. If only one proxy should log, omit that inheritance and place the appropriate log global or explicit endpoint in the selected frontend or backend instead. Keep the facility consistent across all endpoint declarations so that rsyslog’s selector remains predictable.

Configure rsyslog for a UNIX socket

On many Linux systems, the local syslog socket is already available at /dev/log. HAProxy’s documentation notes that GNU libc’s syslog() function commonly sends to that path. Confirm that rsyslog’s local socket input is active in the package defaults before adding another listener; duplicate socket definitions can prevent startup.

Regardless of how the socket input is enabled, add a rule that routes the facility to its own file:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
local0.*    /var/log/haproxy.log
& stop

The first line matches every severity from facility local0 and writes to /var/log/haproxy.log. The following legacy-syntax & stop prevents matching messages from continuing into later rules on rsyslog versions that support that action syntax. If your installed rsyslog release uses a different configuration language or action syntax, use the equivalent supported form and validate it before deployment.

Place the rule where the service actually loads it, commonly a distribution-managed configuration file or a drop-in under the rsyslog configuration directory. Ensure the destination directory exists and is writable by the rsyslog process. If the file is created by a package-managed log policy, preserve the ownership and mode expected by that policy.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Configure rsyslog for UDP input

For the HAProxy endpoint 127.0.0.1:514, rsyslog must load its UDP input module and bind the listener. The following legacy directives are documented by HAProxy:

$ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514

Keep the listener address aligned with the HAProxy address. Binding to loopback prevents other hosts from submitting messages through this input. If a distribution uses modern RainerScript syntax instead of these legacy directives, translate the settings to the syntax supported by that installed version rather than copying both forms.

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.

Retain the same routing rule after enabling the input:

local0.*    /var/log/haproxy.log
& stop

UDP adds two checks that do not exist with a local socket: the module must be loaded and a process must be listening on the selected address and port. A host firewall can also block traffic, even when the sender and receiver are on the same machine, depending on local policy.

Handle chrooted HAProxy correctly

A chroot changes the filesystem view available to the HAProxy process. If HAProxy is configured with a chroot directory, /dev/log from the host is not automatically the same path seen inside that restricted root. The rsyslog socket must exist inside the chroot at the path HAProxy uses.

A typical rsyslog addition is:

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

Replace /var/lib/haproxy with the actual chroot directory configured on your host. Create the parent directories if the package does not create them, and apply the ownership and permissions required by the distribution’s HAProxy service. The path in HAProxy must correspond to the socket location as seen from inside the chroot. For example, a host socket at /var/lib/haproxy/dev/log is addressed as /dev/log by a process whose root has changed to /var/lib/haproxy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Restart or reload rsyslog after adding the socket, then reload or restart HAProxy as required. Test the socket after both services are running; creating it only on the host while omitting it from the chroot leaves HAProxy unable to deliver messages.

Validate syntax and reload in a controlled order

Use the binaries and service manager supplied by the host. The exact unit names and configuration paths vary, but the sequence is consistent:

  1. Validate the HAProxy file with the installed binary’s configuration-check option, for example haproxy -c -f /etc/haproxy/haproxy.cfg. Use the real path on your server and fix every reported error before reloading.
  2. Validate rsyslog syntax with the supported check mode for the installed release. A commonly available command is rsyslogd -N1; confirm the local package documentation if that option differs.
  3. Reload or restart rsyslog through the host’s service manager so that the new rule, UDP module, or chroot socket is active.
  4. Reload HAProxy after rsyslog is ready. If the service manager cannot perform a graceful reload, use the distribution-approved restart operation and account for the connection impact.
  5. Check service status and recent daemon errors before testing traffic. A configuration that passes a parser check can still fail at runtime because of a missing directory, permission problem, occupied UDP port, or unavailable socket.

With a UNIX socket, pay particular attention to reload order after an rsyslog restart. If rsyslog replaces the socket inode, a still-running HAProxy process can retain a dead endpoint. Reloading or restarting HAProxy after rsyslog recreates the socket re-establishes the connection.

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

Generate traffic and confirm the complete path

Do not test only by watching service status; a healthy daemon with no request produces no HTTP access entry. Send a request through the actual HAProxy frontend, using a local command or a client that reaches the listener. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -i http://127.0.0.1/

Use the frontend’s real address, port, and protocol if they differ. Then inspect the configured destination:

tail -f /var/log/haproxy.log

Once a request is processed, verify that a new line appears and that it has the expected HAProxy program identity and local0 facility. If the file is empty, test each boundary separately: confirm HAProxy accepted the configuration, confirm rsyslog is listening or owns the socket, and confirm the route matches the facility.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Troubleshooting by symptom

Symptom Checks and corrective action
No /var/log/haproxy.log file or no entries Confirm the rsyslog rule is loaded, the destination directory exists, and rsyslog can write there. Compare the facility in HAProxy and the selector in rsyslog; both should use local0.
UDP configuration is silent Verify that imudp is enabled, rsyslog is bound to the selected address and port, and local firewall policy permits the traffic. Check that HAProxy and rsyslog use exactly the same port.
UNIX-socket configuration is silent Compare the HAProxy endpoint with the socket path rsyslog actually opens. If HAProxy is chrooted, verify the socket exists below the chroot and that the process can traverse each parent directory.
Messages appear in both the dedicated file and the general system log Add the supported stop or discard action after the dedicated-file action, then inspect distribution defaults for another rule that also handles local0.
Logging works until rsyslog restarts Rsyslog may have replaced the UNIX socket while HAProxy retained the old endpoint. Reload or restart HAProxy after rsyslog, or use a network endpoint whose listener lifecycle is managed independently.
HAProxy reload fails after adding logging Run the installed HAProxy configuration check directly, inspect the reported line, and verify that the endpoint syntax is valid for the HAProxy version. A missing socket does not usually indicate a parser error, so check runtime permissions and service logs as well.
Rsyslog will not start after the change Run its supported syntax check, look for duplicate module or socket declarations, and confirm that UDP port 514 is not already occupied. Restore the last known-good input while correcting the new rule.

Operational choices that prevent recurring failures

Keep one authoritative endpoint

Mixing a stale /dev/log line with a new UDP line makes diagnosis harder and can send messages to a receiver you are not monitoring. Keep the active endpoint explicit in global, and remove obsolete alternatives unless you have a documented reason to send to more than one destination.

Use a dedicated file and a deliberate retention policy

A separate file makes it possible to inspect HAProxy traffic without filtering unrelated system messages. Ensure the file is covered by the host’s log rotation and retention policy, and verify after rotation that rsyslog can continue writing. The rotation mechanism and policy are distribution-specific, so use the system’s existing service conventions rather than applying a generic file ownership change.

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

Limit UDP exposure

When UDP is only for local delivery, bind to 127.0.0.1. A wildcard listener accepts packets from every reachable interface and expands both the firewall surface and the set of messages that rsyslog must process. If remote logging is required, define the remote source, firewall policy, and loss expectations separately from this local configuration.

Test after every lifecycle change

Repeat a real frontend request after changing the rsyslog input, rotating the file, restarting rsyslog, or reloading HAProxy. Socket replacement and permission changes can break delivery even when static configuration files remain unchanged.

A concise deployment checklist

  • HAProxy has one intentional log endpoint in global.
  • The facility is local0 in both HAProxy and the rsyslog selector.
  • log global is inherited by the frontend or backend that should emit entries.
  • For /dev/log, rsyslog owns the matching UNIX socket; for UDP, imudp listens on the matching address and port.
  • A chrooted deployment has the socket inside the configured chroot with usable directory permissions.
  • The rsyslog rule writes to the intended file and uses a supported stop or discard action if duplicates are unwanted.
  • Both configurations pass their installed syntax checks.
  • Rsyslog is ready before HAProxy is reloaded after a socket change.
  • A real request creates a line in the dedicated file, carrying the expected HAProxy identity and facility.

Conclusion

The essential configuration is small: direct HAProxy to /dev/log or loopback UDP with facility local0, enable logging for the relevant proxy sections, and have rsyslog route local0.* to a dedicated file. Most failures come from a mismatched facility, an unbound UDP input, a socket hidden by chroot, or a socket replaced during an rsyslog restart. Validate both daemons, reload them in the right order, and prove the path with an actual request rather than relying on service status alone.

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.

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

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 quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

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.