File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed
cx-agent-backend/cx_agent_backend Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 11"""CX demo agent package including agent definition and AgentCore-compatible REST server"""
22
3- # Configure structured logging here during module initialization, before other local and external
4- # imports start creating loggers:
3+ # TODO: Review how log level configuration can fit together with other settings
4+ # We need to configure logging here during module initialization, **before** other local and
5+ # external imports start creating loggers with their own default levels, formats, etc.
6+ import logging
7+ from os import environ
58import structlog
69
10+ # Basic terminal logging:
11+ logging .basicConfig (
12+ level = environ .get ("LOG_LEVEL" , "INFO" ).upper (),
13+ format = '%(asctime)s %(name)s [%(levelname)s] %(message)s' ,
14+ datefmt = '%Y-%m-%dT%H:%M:%S'
15+ )
16+
17+ # Structured logging:
718structlog .configure (
819 processors = [
920 structlog .stdlib .filter_by_level ,
Original file line number Diff line number Diff line change 88from fastapi import FastAPI , HTTPException , Request
99import structlog
1010
11- # Configure basic logging to terminal
12- logging .basicConfig (
13- level = logging .INFO ,
14- format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' ,
15- handlers = [
16- logging .StreamHandler (sys .stdout )
17- ]
18- )
19-
2011from cx_agent_backend .infrastructure .config .container import Container
2112from cx_agent_backend .infrastructure .config .settings import settings
2213from cx_agent_backend .presentation .api .conversation_router import (
You can’t perform that action at this time.
0 commit comments