feat(v0.1.0): project foundation with logging and config
This commit is contained in:
98
config/logging.yaml
Normal file
98
config/logging.yaml
Normal file
@@ -0,0 +1,98 @@
|
||||
version: 1
|
||||
disable_existing_loggers: false
|
||||
|
||||
formatters:
|
||||
json:
|
||||
class: pythonjsonlogger.jsonlogger.JsonFormatter
|
||||
format: '%(asctime)s %(name)s %(levelname)s %(message)s %(pathname)s %(lineno)d'
|
||||
datefmt: '%Y-%m-%d %H:%M:%S'
|
||||
|
||||
detailed:
|
||||
format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s - [%(pathname)s:%(lineno)d]'
|
||||
datefmt: '%Y-%m-%d %H:%M:%S'
|
||||
|
||||
colored:
|
||||
format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
datefmt: '%Y-%m-%d %H:%M:%S'
|
||||
# Note: ColoredFormatter requires colorlog package
|
||||
# Falls back to standard formatter if colorlog not available
|
||||
|
||||
handlers:
|
||||
console:
|
||||
class: logging.StreamHandler
|
||||
level: INFO
|
||||
formatter: colored
|
||||
stream: ext://sys.stdout
|
||||
filters:
|
||||
- sensitive_data_filter
|
||||
|
||||
application_file:
|
||||
class: logging.handlers.RotatingFileHandler
|
||||
level: DEBUG
|
||||
formatter: json
|
||||
filename: logs/application/app.log
|
||||
maxBytes: 10485760 # 10MB
|
||||
backupCount: 5
|
||||
encoding: utf-8
|
||||
filters:
|
||||
- sensitive_data_filter
|
||||
|
||||
error_file:
|
||||
class: logging.handlers.RotatingFileHandler
|
||||
level: ERROR
|
||||
formatter: json
|
||||
filename: logs/errors/exceptions.log
|
||||
maxBytes: 10485760 # 10MB
|
||||
backupCount: 5
|
||||
encoding: utf-8
|
||||
filters:
|
||||
- sensitive_data_filter
|
||||
|
||||
critical_file:
|
||||
class: logging.handlers.RotatingFileHandler
|
||||
level: CRITICAL
|
||||
formatter: json
|
||||
filename: logs/errors/critical.log
|
||||
maxBytes: 10485760 # 10MB
|
||||
backupCount: 10
|
||||
encoding: utf-8
|
||||
filters:
|
||||
- sensitive_data_filter
|
||||
|
||||
loggers:
|
||||
src:
|
||||
level: DEBUG
|
||||
handlers:
|
||||
- console
|
||||
- application_file
|
||||
- error_file
|
||||
- critical_file
|
||||
propagate: false
|
||||
|
||||
src.detectors:
|
||||
level: DEBUG
|
||||
handlers:
|
||||
- console
|
||||
- application_file
|
||||
propagate: false
|
||||
|
||||
src.models:
|
||||
level: DEBUG
|
||||
handlers:
|
||||
- console
|
||||
- application_file
|
||||
propagate: false
|
||||
|
||||
src.trading:
|
||||
level: INFO
|
||||
handlers:
|
||||
- console
|
||||
- application_file
|
||||
propagate: false
|
||||
|
||||
root:
|
||||
level: INFO
|
||||
handlers:
|
||||
- console
|
||||
- application_file
|
||||
|
||||
Reference in New Issue
Block a user