Skip to content

feat : Service & Repository 에 대한 logging (AOP) 추가#17

Merged
rll2641 merged 7 commits intodevelopfrom
feature/fast-logging
Aug 27, 2025
Merged

feat : Service & Repository 에 대한 logging (AOP) 추가#17
rll2641 merged 7 commits intodevelopfrom
feature/fast-logging

Conversation

@rll2641
Copy link
Collaborator

@rll2641 rll2641 commented Aug 27, 2025

:메모: 작업 내용

  • FastAPI에서 의존성 주입을 활용한 AOP 기반 계층별 로깅 시스템 구현
  • Request → LoggingMiddleware → ServiceDependency / RepositoryDependency → Endpoint
라우터 예시
@router.post("/search")
async def vector_search(
    query: str,
    top_k: int = 10,
    request: Request = None,
    _: None = Depends(vector_db_dependency),
    __: None = Depends(log_repository_response)
):
실행 결과 
2025-08-26 23:58:43.036 | INFO     | app.middleware.logging:dispatch:21 - [REQUEST_START] trace_id=abd9c35d method=POST url=/chunk ip=127.0.0.1
2025-08-26 23:58:43.037 | INFO     | app.config.logging.ServiceLoggerDependency:__call__:32 - [CHUNKING_START] trace_id=NO_TRACE_ID text=my name is jihoon chunk_size=100 overlap=20
2025-08-26 23:58:43.037 | INFO     | app.config.logging.ServiceLoggerDependency:log_service_response:83 - [CHUNKING_SUCCESS] trace_id=NO_TRACE_ID execution_time=0.0004s text=my name is jihoon chunk_size=100 overlap=20
2025-08-26 23:58:43.038 | INFO     | app.middleware.logging:dispatch:31 - [REQUEST_SUCCESS] trace_id=abd9c35d method=POST url=/chunk status=200 time=0.0013s

kakusiA and others added 6 commits August 22, 2025 14:18
패턴 : [작업타입_상태] trace_id=추적ID(UUID) operation=작업명 파라미터(변경가능) [결과정보]
예시 :
 [CHUNKING_START] trace_id=abc123 operation=CHUNKING_CHUNK_DOCUMENTS chunk_size=1000 overlap=100 documents_count=50
 [RDB_START] trace_id=def456 operation=RDB_SELECT_GET_USERS limit=100 offset=0
@rll2641 rll2641 self-assigned this Aug 27, 2025
# Conflicts:
#	apps/pre-processing-service/app/api/router.py
#	apps/pre-processing-service/app/core/config.py
#	apps/pre-processing-service/app/db/db_connecter.py
#	apps/pre-processing-service/app/main.py
#	apps/pre-processing-service/poetry.lock
#	apps/pre-processing-service/pyproject.toml
@rll2641 rll2641 merged commit e0d0678 into develop Aug 27, 2025
1 check failed
@rll2641 rll2641 deleted the feature/fast-logging branch August 27, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants