@@ -64,13 +64,15 @@ def health_check():
6464 Health check endpoint for load balancers and monitoring
6565 Returns 200 if app and database are healthy
6666 """
67+ app .logger .debug ("Endpoint called: /health" )
6768 try :
6869 from .database import db
6970
7071 # Quick ping to verify DB connectivity
7172 with db .engine .connect () as conn :
7273 conn .execute (db .text ("SELECT 1" ))
7374
75+ app .logger .debug ("Health check result: healthy" )
7476 return jsonify ({"status" : "healthy" , "database" : "connected" }), 200
7577 except Exception as e :
7678 app .logger .error (f"Health check failed: { e } " )
@@ -79,10 +81,13 @@ def health_check():
7981 @app .route ("/items/<item_id>/mapping" )
8082 def get_item_mapping (item_id ):
8183 """Get mapping for an item by ID"""
84+ app .logger .debug (f"Endpoint called: /items/{ item_id } /mapping" )
8285 try :
8386 mapping = get_mapping (item_id )
8487 if mapping :
88+ app .logger .debug (f"Item mapping result: { mapping } " )
8589 return jsonify (mapping )
90+ app .logger .debug ("Item mapping result: not found" )
8691 return jsonify ({"error" : "Item not found" }), 404
8792 except Exception as e :
8893 app .logger .error (f"Error getting item mapping: { e } " )
@@ -91,10 +96,13 @@ def get_item_mapping(item_id):
9196 @app .route ("/properties/<property_id>/mapping" )
9297 def get_property_mapping (property_id ):
9398 """Get mapping for a property by ID"""
99+ app .logger .debug (f"Endpoint called: /properties/{ property_id } /mapping" )
94100 try :
95101 mapping = get_mapping (property_id )
96102 if mapping :
103+ app .logger .debug (f"Property mapping result: { mapping } " )
97104 return jsonify (mapping )
105+ app .logger .debug ("Property mapping result: not found" )
98106 return jsonify ({"error" : "Property not found" }), 404
99107 except Exception as e :
100108 app .logger .error (f"Error getting property mapping: { e } " )
@@ -103,8 +111,10 @@ def get_property_mapping(property_id):
103111 @app .route ("/search/items/<path:label>" )
104112 def get_items (label ):
105113 """Search for items by label"""
114+ app .logger .debug (f"Endpoint called: /search/items/{ label } " )
106115 try :
107116 results = search_items (label )
117+ app .logger .debug (f"Item search result: { results } " )
108118 return jsonify (results )
109119 except Exception as e :
110120 app .logger .error (f"Error searching items: { e } " )
@@ -113,8 +123,10 @@ def get_items(label):
113123 @app .route ("/search/properties/<path:label>" )
114124 def get_properties (label ):
115125 """Search for properties by label"""
126+ app .logger .debug (f"Endpoint called: /search/properties/{ label } " )
116127 try :
117128 results = search_properties (label )
129+ app .logger .debug (f"Property search result: { results } " )
118130 return jsonify (results )
119131 except Exception as e :
120132 app .logger .error (f"Error searching properties: { e } " )
0 commit comments