배치 실계좌에서 종목조회로 변경
This commit is contained in:
@@ -27,22 +27,24 @@ from app.core.market_schedule import is_market_open
|
||||
# 로깅 설정
|
||||
import os
|
||||
import logging.handlers
|
||||
from app.core.logging_config import KSTFormatter
|
||||
_log_level = getattr(logging, settings.LOG_LEVEL.upper(), logging.INFO)
|
||||
_log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
_log_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "logs")
|
||||
os.makedirs(_log_dir, exist_ok=True)
|
||||
_log_file = os.path.join(_log_dir, "backend.log")
|
||||
|
||||
logging.basicConfig(
|
||||
level=_log_level,
|
||||
format=_log_format,
|
||||
handlers=[
|
||||
logging.StreamHandler(),
|
||||
logging.handlers.RotatingFileHandler(
|
||||
_log_file, maxBytes=10 * 1024 * 1024, backupCount=5, encoding="utf-8"
|
||||
),
|
||||
]
|
||||
)
|
||||
_formatter = KSTFormatter(_log_format)
|
||||
_handlers: list[logging.Handler] = [
|
||||
logging.StreamHandler(),
|
||||
logging.handlers.RotatingFileHandler(
|
||||
_log_file, maxBytes=10 * 1024 * 1024, backupCount=5, encoding="utf-8"
|
||||
),
|
||||
]
|
||||
for _h in _handlers:
|
||||
_h.setFormatter(_formatter)
|
||||
|
||||
logging.basicConfig(level=_log_level, handlers=_handlers)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user