-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
44 lines (40 loc) · 1.02 KB
/
config.py
File metadata and controls
44 lines (40 loc) · 1.02 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
WebShield - Web应用漏洞扫描器
配置文件
"""
import os
# 基础目录
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
# 日志配置
LOG_CONFIG = {
'version': 1,
'formatters': {
'default': {
'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
'datefmt': '%Y-%m-%d %H:%M:%S'
},
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'level': 'INFO',
'formatter': 'default',
'stream': 'ext://sys.stdout'
},
'file': {
'class': 'logging.handlers.RotatingFileHandler',
'level': 'INFO',
'formatter': 'default',
'filename': os.path.join(BASE_DIR, 'logs', 'webshield.log'),
'maxBytes': 10485760, # 10MB
'backupCount': 5,
'encoding': 'utf8'
},
},
'root': {
'level': 'INFO',
'handlers': ['console', 'file']
}
}