Skip to content

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

can019 and others added 11 commits August 21, 2025 20:10
* chore: init user auth service

* chore: init security config

* chore: init application.yml
* chore: Spotless

* chore: spotless java workflow

* chore: fix lint
 Changes to be committed:
	renamed:    preprocessing-service/app/api/router.py -> pre-processing-service/app/api/router.py
	renamed:    preprocessing-service/app/core/config.py -> pre-processing-service/app/core/config.py
	renamed:    preprocessing-service/app/db/db_connecter.py -> pre-processing-service/app/db/db_connecter.py
	renamed:    preprocessing-service/app/main.py -> pre-processing-service/app/main.py
	renamed:    preprocessing-service/app/services/preprocessing_service.py -> pre-processing-service/app/services/preprocessing_service.py
	renamed:    preprocessing-service/test_main.http -> pre-processing-service/test_main.http
패턴 : [작업타입_상태] 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
@can019 can019 changed the title Feature: Service & Repository Layer에 대한 logging (aop) 추가 Service & Repository Layer에 대한 logging (aop) 추가 Aug 27, 2025
@rll2641 rll2641 closed this Aug 27, 2025
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.

4 participants