监视日志文件并将其上载到log.fit
logfit的Python项目详细描述
logfit守护进程监视日志文件并将数据发送到logfit应用程序 用于分析。
安装
待办事项
用法
# Start in foreground mode python3 logfit/client.py [run|foreground]# Start in daemon mode python3 logfit/client.py start # Stop daemon python3 logfit/client.py stop # Restart the daemon python3 logfit/client.py restart # Get the daemon status python3 logfit/client.py status
配置
守护进程可以从logfit_config.yamlconfig文件中读取格式为:
# Required: Get this from your log.fit accountsource:"64a4b9bd88f14511926e0de86f23e2d8"# Optional: The directory the daemon will watchwatch_directory:"/var/log/"# Optional: Minimum log level. Possible options are# critical, error, warning, info, and debuglog_level:"warning"# Optional: File to write daemon logs tolog_file:"logfit.log"# Optional: limit watching log files to given mime typesallowed_mime_types:-text/plain-inode/x-empty# Optional: List of file globs to not watch, should be the# full absolute pathignore_paths:[]
开发
pip install -r requirements-test.txt
coverage run setup.py test
coverage report
flake8
发布
# Publish to PyPI python setup.py sdist bdist_wheel twine upload dist/* # Generate binaries for multiple operating systems pyinstaller logfit/main.py -F -p logfit --hidden-import queue -n logfit_linux_x86_64 pyinstaller logfit/main.py -F -p logfit --hidden-import queue -n logfit_macos_x86_64 pyinstaller logfit/main.py -F -p logfit --hidden-import queue -n logfit_windows_x86_64 # Copy binaries into logfit-daemon-binary