From 96bf1857578430161d8f991c9c70fdc99b2bfa80 Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Fri, 27 Jun 2025 16:16:33 +0800 Subject: [PATCH] 'commit' --- dsRag/Start.py | 18 ++++++++++++++++++ dsRag/日志.txt | 17 +++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 dsRag/日志.txt diff --git a/dsRag/Start.py b/dsRag/Start.py index 6fecfed4..a762b932 100644 --- a/dsRag/Start.py +++ b/dsRag/Start.py @@ -22,6 +22,24 @@ from Util.EsSearchUtil import EsSearchUtil logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) +# 配置日志处理器 +log_file = os.path.join(os.path.dirname(__file__), 'Logs', 'app.log') +os.makedirs(os.path.dirname(log_file), exist_ok=True) + +# 文件处理器 +file_handler = RotatingFileHandler( + log_file, maxBytes=1024*1024, backupCount=5, encoding='utf-8') +file_handler.setFormatter(logging.Formatter( + '%(asctime)s - %(name)s - %(levelname)s - %(message)s')) + +# 控制台处理器 +console_handler = logging.StreamHandler() +console_handler.setFormatter(logging.Formatter( + '%(asctime)s - %(name)s - %(levelname)s - %(message)s')) + +logger.addHandler(file_handler) +logger.addHandler(console_handler) + # 将HTML文件转换为Word文件 def html_to_word_pandoc(html_file, output_file): diff --git a/dsRag/日志.txt b/dsRag/日志.txt new file mode 100644 index 00000000..6eb19f14 --- /dev/null +++ b/dsRag/日志.txt @@ -0,0 +1,17 @@ + D:\anaconda3\envs\rag\python.exe D:\dsWork\dsProject\dsRag\Start.py +INFO: Started server process [10492] +INFO: Waiting for application startup. +INFO: Application startup complete. +INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) +INFO: 10.10.21.22:53660 - "GET /static/ai.html HTTP/1.1" 304 Not Modified +D:\anaconda3\envs\rag\lib\site-packages\elasticsearch\_sync\client\__init__.py:311: SecurityWarning: Connecting to 'https://10.10.14.206:9200' using TLS with verify_certs=False is insecure + _transport = transport_class( +Building prefix dict from the default dictionary ... +Loading model from cache C:\Users\ADMINI~1\AppData\Local\Temp\jieba.cache +Loading model cost 0.879 seconds. +Prefix dict has been built successfully. +D:\anaconda3\envs\rag\lib\site-packages\urllib3\connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.10.14.206'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings + warnings.warn( +D:\anaconda3\envs\rag\lib\site-packages\urllib3\connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.10.14.206'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings + warnings.warn( +INFO: 10.10.21.22:53660 - "POST /api/rag HTTP/1.1" 200 OK \ No newline at end of file