Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Configuring Haproxy log support (syslog logging support)     - Ubuntu 15.10 15.04 14.10 14.04 Install Ubuntu Tweak (Linux)

- Boot-Repair Tool - repair of frequent start-up problems (Linux)

- List Leaves (Programming)

- VPS xen openvz kvm (Server)

- C ++ Const breaking rules (Programming)

- Oracle 11g RMAN cross-platform transfer table space (Database)

- Remote database using RMAN recovery test (RAC return to single-instance database) (Database)

- To create a file in Linux directory by setfacl (Linux)

- CentOS installation Docker series (Linux)

- On Android running ClojureScript (Linux)

- Spark source code compiler package (Linux)

- Spring next ActiveMQ combat (Programming)

- C ++ function object (Programming)

- MySQL common functions summary (Database)

- How to install Git on CentOS 7 (Linux)

- Android project and coding specifications (Programming)

- CentOS 6 Install Linux kernel source (Linux)

- sa weak passwords intrusion prevention (Linux)

- Use Markdown editor for document work under Linux (Linux)

- Linux operating system Study Notes (Linux)

 
         
  Configuring Haproxy log support (syslog logging support)
     
  Add Date : 2018-11-21      
         
       
         
  System CentOS 6.x

Configure logging support Haproxy

cp /etc/rsyslog.conf /etc/rsyslog.conf`date +% F`
ll /etc/rsyslog.con*
cat >> /etc/rsyslog.conf< #haproxy
local0. * /application/haproxy/logs/haproxy.log
#end
EOF

## Should be specified in the configuration file is haproxy local0, so here choose local0. The following configuration haproxy corresponding configuration file:

===============

log 127.0.0.1:514 local0 warning

## Global logging configuration ,, log keyword specifies the syslog 127.0.0.1:514 Service local0 log level, where the choice is warning, do not use general info

================

# Modify / etc / sysconfig / rsyslog reads as follows:

[Root @ MASTER ~] # tail -2 / etc / sysconfig / rsyslog
#SYSLOGD_OPTIONS = "- C 5"
SYSLOGD_OPTIONS = "- c 2 -m 0 -r -x"
[Root @ MASTER ~] #

# Reboot /etc/init.d/rsyslog

/etc/init.d/rsyslog restart

# 6.4 is not the default port

netstat -lntup
 /etc/init.d/rsyslog restart

######## Rsyslog.conf allowed to modify appears port

egrep 'UDPServerRun | ModLoad' /etc/rsyslog.conf
sed -i 's / # $ UDPServerRun 514 / $ UDPServerRun 514 / g' /etc/rsyslog.conf
sed -i 's / # $ ModLoad imudp / $ ModLoad imudp / g' /etc/rsyslog.conf
sed -n -e '/ $ ModLoad imudp / p' -e '/ $ UDPServerRun / p' /etc/rsyslog.conf

# Reboot /etc/init.d/rsyslog

/etc/init.d/rsyslog restart
  netstat -lntup | grep rsyslog
  
[Root @ MASTER ~] # netstat -lntup | grep rsyslog
udp 0 0 0.0.0.0:514 0.0.0.0:* 5031 / rsyslogd
udp 0 0 ::: 514 ::: * 5031 / rsyslogd
[Root @ MASTER ~] #
  ====================
[Root @ MASTER ~] # cat /application/haproxy/logs/haproxy.log
Nov 6 10:58:49 127.0.0.1 haproxy [5049]: Stopping proxy test in 0 ms.
Nov 6 10:58:49 127.0.0.1 haproxy [5049]: Proxy test stopped (FE: 0 conns, BE: 0 conns).
Nov 6 10:58:58 127.0.0.1 haproxy [5055]: Stopping proxy test in 0 ms.
Nov 6 10:58:58 127.0.0.1 haproxy [5055]: Proxy test stopped (FE: 0 conns, BE: 0 conns).
[Root @ MASTER ~] #

### Note that if you still can not log, remember to turn off selinux
     
         
       
         
  More:      
 
- Installation on the way to the root source Ubuntu Server 14.04 LTS version Odoo8.0 (Server)
- Sorting Algorithm (1) Quick Sort C ++ implementation (Programming)
- Ubuntu cut screen method (Linux)
- CentOS 6.5 installation and configuration Cobbler (Server)
- Bash difference in single quotes and double quotes (Programming)
- How to find on Linux and delete duplicate files: FSlint (Linux)
- Through the source code to install MySQL 5.6.26 under CentOS6 (Database)
- Linux common network tools: ping host sweep (Linux)
- Linux NIC driver and version information (Linux)
- CentOS and RHEL to install IPython 0.11 (Linux)
- RAID disk array Description (Linux)
- RHEL 6.5 x86_64 CentOS yum configuration source (Linux)
- How to set the default Fedora from the command line (Linux)
- Bash How to read a file line by line (Programming)
- Linux character device - automatically creates the device nodes and devices (Linux)
- Oracle JDK installation under Ubuntu Linux (Linux)
- MySQL import large amounts of data (Database)
- Android imitation UC browser scroll up and down functions (Programming)
- Android Studio and Git Git configuration file status (Linux)
- MySQL 5.6 database code changes (Database)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.