Add app_name to log_context in Bitbucket and GitLab webhook handlers

This commit is contained in:
Ori Kotek
2024-08-12 16:10:41 +03:00
parent ef37271ce9
commit b59111e4a6
2 changed files with 3 additions and 1 deletions

View File

@ -93,7 +93,8 @@ async def _perform_commands_bitbucket(commands_conf: str, agent: PRAgent, api_ur
@router.post("/webhook")
async def handle_github_webhooks(background_tasks: BackgroundTasks, request: Request):
log_context = {"server_type": "bitbucket_app"}
app_name = get_settings().get("CONFIG.APP_NAME", "Unknown")
log_context = {"server_type": "bitbucket_app", "app_name": app_name}
get_logger().debug(request.headers)
jwt_header = request.headers.get("authorization", None)
if jwt_header: