flask-logfile
一个高可用的Flask日志文件插件
安装
pip install flask_logfile
示例
import logging
from flask import Flask
from flask_logfile import LogFile
app = Flask(__name__)
app.config['LOG_LEVEL'] = logging.INFO
app.config['LOG_FILE'] = '`logs/main.log`'
LogFile().init_app(app)
app.logger.debug('debug')
app.logger.info('info')
app.logger.warning('warning')
app.logger.error('error')
配置说明
| 配置变量 | 功能说明 |
|---|---|
| LOG_LEVEL | 日志等级,同logging模块,默认:DEBUG |
| LOG_DATE_FORMAT | 日志时间格式,默认:%Y-%m-%d %H:%M:%S |
| LOG_STREAM_FORMAT | 控制台日志格式,可参考官方文档 |
| LOG_FILE | 日志文件路径,默认:logs/flask.log |
| LOG_FILE_ENCODING | 日志文件编码,默认:utf8 |
| LOG_FILE_FORMAT | 日志文件日志格式,可参考官方文档 |
| LOG_FILE_SPLIT_UNIT | 日志文件拆分时间单位,默认:d(天) |
| FILE_SPLIT_INTERVAL | 日志文件拆分间隔,默认:1个时间单元 |
| LOG_FILE_BACKUP_COUNT | 日志文件备份数量,默认:0 |
Metadata
Release files for flask-logfile 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flask-logfile-0.0.2.tar.gz | 3.4 kB | Without provenance | Details for flask-logfile-0.0.2.tar.gz |
Release files / flask-logfile-0.0.2.tar.gz
| Download URL | flask-logfile-0.0.2.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
194bdf321fb2bd6ee2331f429cf15e0c03580d690cd9c8ecf15c6c9e0134c700
|
|
BLAKE2b-256 checksum How to use checksums |
e7d148f0ef8e0959a955a0d4c2f37cdda0e0b950d03c1515fc0d955dedda0b19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.8.5
|
Security for flask-logfile 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.