zoukankan      html  css  js  c++  java
  • Ubuntu系统日志

    一、指定系统日志路径到:  /var/log/messages

    1、默认系统日志

    root@HDController:~# tail -1000 /var/log/syslog
    Oct 20 06:26:01 HDController CRON[6071]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:27:01 HDController CRON[6085]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:28:01 HDController CRON[6099]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:29:01 HDController CRON[6114]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:30:01 HDController CRON[6128]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:31:01 HDController CRON[6144]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:32:01 HDController CRON[6158]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:33:01 HDController CRON[6172]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:34:01 HDController CRON[6186]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:35:01 HDController CRON[6200]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:36:01 HDController CRON[6214]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:37:01 HDController CRON[6228]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:38:01 HDController CRON[6243]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:39:01 HDController CRON[6257]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    

    2、系统默认引用路径配置文件地址

    root@HDController:~# vi /etc/rsyslog.d
    
    " ============================================================================
    " Netrw Directory Listing                                        (netrw v155)
    "   /etc/rsyslog.d
    "   Sorted by      name
    "   Sort sequence: [/]$,<core\%(.d+)=>,.h$,.c$,.cpp$,~=*$,*,.o$,.obj$,.info$,.swp
    "   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:special
    " ==============================================================================
    ../                                                                                                
    ./
    20-ufw.conf
    50-default.conf  #系统默认日志路径
    ~                                                                                                  
    ~                         

    3、更改系统默认日志路径

    root@HDController:~# vi /etc/rsyslog.d/50-default.conf 
    #  Default rules for rsyslog.
    #
    #			For more information see rsyslog.conf(5) and /etc/rsyslog.conf
    
    #
    # First some standard log files.  Log by facility.
    #
    auth,authpriv.*			/var/log/auth.log
    #*.*;auth,authpriv.none		-/var/log/syslog  #注释掉这行
    #cron.*				/var/log/cron.log
    #daemon.*			-/var/log/daemon.log
    kern.*				-/var/log/kern.log
    #lpr.*				-/var/log/lpr.log
    mail.*				-/var/log/mail.log
    #user.*				-/var/log/user.log
    
    #add system log at 2017-10-20
    *.info;mail.none;authpriv.none;cron.none /var/log/messages
    

    #添加完成,reboot 系统就会生效。

    4、查看系统日志

    root@HDController:~# tail -100 /var/log/messages
    Oct 20 06:26:01 HDController CRON[6071]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:27:01 HDController CRON[6085]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:28:01 HDController CRON[6099]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:29:01 HDController CRON[6114]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:30:01 HDController CRON[6128]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:31:01 HDController CRON[6144]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:32:01 HDController CRON[6158]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:33:01 HDController CRON[6172]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:34:01 HDController CRON[6186]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:35:01 HDController CRON[6200]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:36:01 HDController CRON[6214]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:37:01 HDController CRON[6228]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:38:01 HDController CRON[6243]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    Oct 20 06:39:01 HDController CRON[6257]: (root) CMD (sudo /www/gxycloud/init.d/serverReset)
    

      

     

  • 相关阅读:
    精灵点点基础教程1 -- 下载与安装
    技术人员搞公司还是省省吧
    企业级自定义表单引擎解决方案(二)--架构及核心模块设计
    企业级自定义表单引擎解决方案(一)--总体介绍
    .net core quartz job作业调度管理组件
    NPOI读写Excel组件封装Excel导入导出组件
    企业级工作流解决方案(十七)--工作流--工作流插件模型
    企业级工作流解决方案(十六)--工作流--工作流实体模型
    企业级工作流解决方案(十五)--集成Abp和ng-alain--Abp其他改造
    企业级工作流解决方案(十四)--集成Abp和ng-alain--自动化脚本
  • 原文地址:https://www.cnblogs.com/nulige/p/7699647.html
Copyright © 2011-2022 走看看