• HAProxy日志开启


    安装完haproxy后默认是没有启用日志的,如果需要日志配置,那么需要结合rsyslog

    修改haproxy配置

    在全局配置段中配置,定义日志记录级别。

    global
        log 127.0.0.1 local3  info
    

    修改rsyslog配置

    #日志传输基于udp
    [root@LB ~]# sed -n '21,22p' /etc/rsyslog.conf
    $ModLoad imudp
    $UDPServerRun 514
    
    #文件末尾添加
    local3.*			/var/log/haproxy.log
    
    [root@LB ~]# systemctl restart haproxy rsyslog
    

    没什么问题后访问一下就会在/var/log/haproxy.log中看到日志

    [root@LB ~]# tail -f /var/log/haproxy.log
    May 10 07:00:15 localhost haproxy[1760]: Connect from 192.168.248.1:62485 to 192.168.248.200:443 (https/TCP)
    May 10 07:00:15 localhost haproxy[1760]: Connect from 192.168.248.1:62486 to 192.168.248.200:443 (https/TCP)
    May 10 07:00:20 localhost haproxy[1760]: Connect from 192.168.248.1:62490 to 192.168.248.200:443 (https/TCP)
    May 10 07:00:20 localhost haproxy[1760]: Connect from 192.168.248.1:62491 to 192.168.248.200:443 (https/TCP)
    May 10 07:00:24 localhost haproxy[1760]: Connect from 192.168.248.1:62495 to 192.168.248.200:443 (https/TCP)
    
  • 相关阅读:
    使用NodeJS模块-第三方提供的模块(什么是npm)
    nodejs编写后台
    解决npm下载慢的问题
    全局安装与本地安装
    NPM常用命令
    使用NodeJS模块-NodeJS官方提供的核心模块
    导出模块成员
    Node.js提供了哪些内容(API)
    node.js的安装
    什么是node.js
  • 原文地址:https://www.cnblogs.com/diqiyao/p/14749274.html
Copyright © 2020-2023  润新知