欧美一区2区三区4区公司二百,国产精品婷婷午夜在线观看,自拍偷拍亚洲精品,国产美女诱惑一区二区

歡迎來到夢飛科技

服務器租用

當前優惠活動:

利用 loggly 來統一打點 nginx 日志

Nginx會把access和error日志記錄到文件中,利用Syslog歷程(如:rsyslog)可以監控這些日志而且將他們發送到Loggly中,下面就是如何利用Loggly來記載nginx的日志。本例中的rsylog利用1.19或更高版本,利用TCP 514端口,,Ubuntu上默認的Nginx日志目次和尺度的日志名目。
自動安裝劇本
1. 運行Nginx設置劇本
運行如下腳原來搭建Nginx日志并傳輸到Loggly上。

 

curl -O https://www.loggly.com/install/configure-nginx.sh
sudo bash configure-nginx.sh -a SUBDOMAIN -u USERNAME

 

 

curl -O https://www.loggly.com/install/configure-nginx.sh

sudo bash configure-nginx.sh -a SUBDOMAIN -u USERNAME

說明:
SUBDOMAIN 是你在Loggly上面注冊的子域名
USERNAME 是你的Loggly的用戶名

2. 確認事件
在Loggly上確認nginx標簽是否已經打上。大概需要換上幾分鐘同步,假如沒有可以憑據如下步調舉辦troubleshooting。
tag:nginx
操作 loggly 來統一解決 nginx 日志

手動設置
1. 設置Syslog Daemon

 

curl -O https://www.loggly.com/install/configure-linux.sh
sudo bash configure-linux.sh -a SUBDOMAIN -u USERNAME

 

 

curl -O https://www.loggly.com/install/configure-linux.sh

sudo bash configure-linux.sh -a SUBDOMAIN -u USERNAME

同樣:
SUBDOMAIN 是你在Loggly上面注冊的子域名
USERNAME 是你的Loggly的用戶名

2. 設置Nginx文件監控
建設可能打開rsyslog設置文件:

 

sudo vim /etc/rsyslog.d/21-nginx-loggly.conf

 

 

sudo vim /etc/rsyslog.d/21-nginx-loggly.conf

將下面的部門添加進去:

 

$ModLoad imfile
$InputFilePollInterval 10
$PrivDropToGroup adm
$WorkDirectory /var/spool/rsyslog
# Nginx access file:
$InputFileName /var/log/nginx/access.log
$InputFileTag nginx-access:
$InputFileStateFile stat-nginx-access
$InputFileSeverity info
$InputFilePersistStateInterval 20000
$InputRunFileMonitor
#Nginx Error file:
$InputFileName /var/log/nginx/error.log
$InputFileTag nginx-error:
$InputFileStateFile stat-nginx-error
$InputFileSeverity error
$InputFilePersistStateInterval 20000
$InputRunFileMonitor
#Add a tag for nginx events
$template LogglyFormatNginx,"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [[email protected] tag=\"nginx\"] %msg%\n"
if $programname == 'nginx-access' then @@logs-01.loggly.com:514;LogglyFormatNginx
if $programname == 'nginx-access' then ~
if $programname == 'nginx-error' then @@logs-01.loggly.com:514;LogglyFormatNginx
if $programname == 'nginx-error' then ~

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

$ModLoad imfile

$InputFilePollInterval 10

$PrivDropToGroup adm

$WorkDirectory /var/spool/rsyslog

# Nginx access file:

$InputFileName /var/log/nginx/access.log

$InputFileTag nginx-access:

$InputFileStateFile stat-nginx-access

$InputFileSeverity info

$InputFilePersistStateInterval 20000

$InputRunFileMonitor

#Nginx Error file:

$InputFileName /var/log/nginx/error.log

$InputFileTag nginx-error:

$InputFileStateFile stat-nginx-error

$InputFileSeverity error

$InputFilePersistStateInterval 20000

$InputRunFileMonitor

夢飛科技 - 全球數據中心基礎服務領先供應商

Copyright © 2003-2019 MFISP.COM. 國外服務器租用 IDC公司 版權所有 ? 粵ICP備11019662號

主站蜘蛛池模板: 家居| 泰州市| 太谷县| 泰和县| 江安县| 柏乡县| 许昌县| 沂源县| 石楼县| 阳原县| 西盟| 金平| 和平县| 宁乡县| 政和县| 隆尧县| 宁都县| 托克托县| 逊克县| 绵竹市| 平舆县| 凉山| 商丘市| 鸡泽县| 台北市| 利津县| 山阳县| 双峰县| 广丰县| 梅河口市| 辉南县| 鹰潭市| 汉寿县| 津市市| 平阳县| 余庆县| 永登县| 扬中市| 绥德县| 怀化市| 蒲江县|
  • <th id="wgaqi"></th>
      <th id="wgaqi"></th>
    • <kbd id="wgaqi"><pre id="wgaqi"></pre></kbd>
      <ul id="wgaqi"><center id="wgaqi"></center></ul>
      <tr id="wgaqi"></tr>