<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux Admin Zone &#187; haproxy logs</title>
	<atom:link href="http://linuxadminzone.com/tag/haproxy-logs/feed/" rel="self" type="application/rss+xml" />
	<link>http://linuxadminzone.com</link>
	<description>Adding more reasons to celebrate Open Source.</description>
	<lastBuildDate>Wed, 09 May 2012 10:17:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Enable or fix logging for HAProxy load balancer</title>
		<link>http://linuxadminzone.com/enable-or-fix-logging-for-haproxy-load-balancer/</link>
		<comments>http://linuxadminzone.com/enable-or-fix-logging-for-haproxy-load-balancer/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 07:01:15 +0000</pubDate>
		<dc:creator>jagbir</dc:creator>
				<category><![CDATA[Load Balancer]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[haproxy logs]]></category>

		<guid isPermaLink="false">http://linuxadminzone.com/?p=90</guid>
		<description><![CDATA[After configuration of HAProxy to balance web traffic, I&#8217;ve noticed that HAProxy is not generating any logs in my server. Due to its load balancer role, logging is vital to diagnose any issue that might come in future. In its default config, HAProxy send logs to a syslog facility: local0, via a socket connection. By [...]]]></description>
			<content:encoded><![CDATA[<p>After configuration of <a href="http://linuxadminzone.com/install-and-configure-haproxy-the-software-based-loadbalancer-in-ubuntu/">HAProxy</a> to balance web traffic, I&#8217;ve noticed that HAProxy is not generating any logs in my server. Due to its load balancer role, logging is vital to diagnose any issue that might come in future. </p>
<p>In its default config, HAProxy send logs to a syslog facility: local0, via a socket connection. By default, your syslog configuration probably doesn’t accept socket connections, and even doesn’t have a local0 facility, so you have no HAProxy log. If you want it, configure syslog to accept TCP connections by adding -r to syslogd parameters.</p>
<p>On a RedHat/CentOS server, edit the value of SYSLOGD_OPTIONS in /etc/sysconfig/syslog:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">SYSLOGD_OPTIONS</span>=<span style="color: #ff0000;">&quot;-m 0 -r&quot;</span></pre></div></div>

<p>On a Debian/Ubuntu server, edit the value of SYSLOGD in /etc/default/syslogd:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">SYSLOGD</span>=<span style="color: #ff0000;">&quot;-r&quot;</span></pre></div></div>

<p>Then set up syslog facility local0 and direct it to file /var/log/haproxy.log or your desired location by editing /etc/syslog.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">local0.<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>haproxy.log</pre></div></div>

<p>finally, restart syslog service to apply changes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>syslog restart</pre></div></div>

<p>You can see that HAProxy logging is started.</p>
<p>Other useful article on this blog that you may like to read:<br />
* <a href="http://linuxadminzone.com/how-to-install-setup-and-config-haproxy-loadbalancer-for-content-switching/">Configure HAProxy for content switching</a><br />
* <a href="http://linuxadminzone.com/5-steps-to-secure-your-linux-server/">5 Steps to secure your Production Linux Server</a><br />
* <a href="http://linuxadminzone.com/ensuring-secure-access-to-production-linux-servers/">Ensuring secure access to your Production Linux Server</a><br />
* <a href="http://linuxadminzone.com/bash-script-to-backup-essential-log-files-of-linux-server/">Bash script to backup essential log files in Linux Server</a></p>
]]></content:encoded>
			<wfw:commentRss>http://linuxadminzone.com/enable-or-fix-logging-for-haproxy-load-balancer/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

