Skip to content

Commit bfe55b3

Browse files
feat: standardize logging configuration across backend services (#1297)
1 parent b88b61d commit bfe55b3

3 files changed

Lines changed: 6 additions & 115 deletions

File tree

backend/app/logging/setup_logging.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,9 @@ def emit(self, record: logging.LogRecord) -> None:
237237
"""
238238
# Get the appropriate module name
239239
module_name = record.name
240-
if "." in module_name:
240+
if module_name.startswith("uvicorn"):
241+
module_name = "uvicorn"
242+
elif "." in module_name:
241243
module_name = module_name.split(".")[-1]
242244

243245
# Create a message that includes the original module in the format

docs/backend/backend_python/openapi.json

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,119 +2073,6 @@
20732073
],
20742074
"title": "DeleteFoldersResponse"
20752075
},
2076-
"app__schemas__folders__ErrorResponse": {
2077-
"properties": {
2078-
"success": {
2079-
"type": "boolean",
2080-
"title": "Success",
2081-
"default": false
2082-
},
2083-
"message": {
2084-
"anyOf": [
2085-
{
2086-
"type": "string"
2087-
},
2088-
{
2089-
"type": "null"
2090-
}
2091-
],
2092-
"title": "Message"
2093-
},
2094-
"error": {
2095-
"anyOf": [
2096-
{
2097-
"type": "string"
2098-
},
2099-
{
2100-
"type": "null"
2101-
}
2102-
],
2103-
"title": "Error"
2104-
}
2105-
},
2106-
"type": "object",
2107-
"title": "ErrorResponse"
2108-
},
2109-
"app__schemas__face_clusters__ErrorResponse": {
2110-
"properties": {
2111-
"success": {
2112-
"type": "boolean",
2113-
"title": "Success",
2114-
"default": false
2115-
},
2116-
"message": {
2117-
"anyOf": [
2118-
{
2119-
"type": "string"
2120-
},
2121-
{
2122-
"type": "null"
2123-
}
2124-
],
2125-
"title": "Message"
2126-
},
2127-
"error": {
2128-
"anyOf": [
2129-
{
2130-
"type": "string"
2131-
},
2132-
{
2133-
"type": "null"
2134-
}
2135-
],
2136-
"title": "Error"
2137-
}
2138-
},
2139-
"type": "object",
2140-
"title": "ErrorResponse"
2141-
},
2142-
"app__schemas__images__ErrorResponse": {
2143-
"properties": {
2144-
"success": {
2145-
"type": "boolean",
2146-
"title": "Success",
2147-
"default": false
2148-
},
2149-
"message": {
2150-
"type": "string",
2151-
"title": "Message"
2152-
},
2153-
"error": {
2154-
"type": "string",
2155-
"title": "Error"
2156-
}
2157-
},
2158-
"type": "object",
2159-
"required": [
2160-
"message",
2161-
"error"
2162-
],
2163-
"title": "ErrorResponse"
2164-
},
2165-
"app__schemas__user_preferences__ErrorResponse": {
2166-
"properties": {
2167-
"success": {
2168-
"type": "boolean",
2169-
"title": "Success"
2170-
},
2171-
"error": {
2172-
"type": "string",
2173-
"title": "Error"
2174-
},
2175-
"message": {
2176-
"type": "string",
2177-
"title": "Message"
2178-
}
2179-
},
2180-
"type": "object",
2181-
"required": [
2182-
"success",
2183-
"error",
2184-
"message"
2185-
],
2186-
"title": "ErrorResponse",
2187-
"description": "Error response model"
2188-
},
21892076
"FaceSearchRequest": {
21902077
"properties": {
21912078
"path": {

sync-microservice/app/logging/setup_logging.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ def emit(self, record: logging.LogRecord) -> None:
245245
"""
246246
# Get the appropriate module name
247247
module_name = record.name
248-
if "." in module_name:
248+
if module_name.startswith("uvicorn"):
249+
module_name = "uvicorn"
250+
elif "." in module_name:
249251
module_name = module_name.split(".")[-1]
250252

251253
# Create a message that includes the original module in the format

0 commit comments

Comments
 (0)