查看运行日志

当Lepus启动时,Lepus提供了标准的日志输出功能,可以通过日志查询监控系统是否正在工作。

# cd /usr/local/lepus/

# tail -f logs/lepus.log 

2015-01-07 18:24:42 [WARNING] check os: not found any servers

2015-01-07 18:24:42 [INFO] check os controller finished.

2015-01-07 18:25:15 [INFO] alarm controller started.

2015-01-07 18:25:15 [INFO] alarm controller finished.

2015-01-07 18:25:37 [INFO] check mysql controller started.

2015-01-07 18:25:37 [WARNING] check mysql: not found any servers

2015-01-07 18:25:37 [INFO] check mysql controller finished.

2015-01-07 18:25:42 [INFO] check os controller started.

2015-01-07 18:25:42 [WARNING] check os: not found any servers

2015-01-07 18:25:42 [INFO] check os controller finished.


除了上述日志文件外,你也可以通过查看nohup.out文件查看输出信息,该文件将记录了比上述错误日志更加完善的错误信息。因为一些程序运行的错误信息可能并未记录到lepus.log里面。所以如果运行有问题,建议大家通过查看nohup.out来寻找问题。

[root@www lepus]# tail -f nohup.out 

  File "check_mongodb.py", line 9, in <module>

    import pymongo

ImportError: No module named pymongo

Traceback (most recent call last):

  File "check_redis.py", line 8, in <module>

    import redis

ImportError: No module named redis

2015-01-07 18:26:43 [INFO] check os controller started.

2015-01-07 18:26:43 [WARNING] check os: not found any servers

2015-01-07 18:26:43 [INFO] check os controller finished.

Traceback (most recent call last):

  File "check_oracle.py", line 9, in <module>

    import cx_Oracle

ImportError: No module named cx_Oracle

2015-01-07 18:27:35 [INFO] alarm controller started.

2015-01-07 18:27:35 [INFO] alarm controller finished.

2015-01-07 18:27:37 [INFO] check mysql controller started.

2015-01-07 18:27:37 [WARNING] check mysql: not found any servers

2015-01-07 18:27:37 [INFO] check mysql controller finished.


AD:如果您觉得我们的产品或文档对您的工作有很大帮助,可以小额捐助我们, 点击参与lepus众筹活动

本章节创建日期:2015-01-07 最后修订日期:2015-01-07 浏览次数:16190