Skip to content

Commit d0bcef3

Browse files
committed
refactor(logging): upgrade log level from debug to info for S3 ops
1 parent 263b4cd commit d0bcef3

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/server/query_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def _store_digest_content(
165165
)
166166
try:
167167
upload_metadata_to_s3(metadata=metadata, s3_file_path=s3_file_path, ingest_id=query.id)
168-
logger.debug("Successfully uploaded metadata to S3")
168+
logger.info("Successfully uploaded metadata to S3")
169169
except Exception as metadata_exc:
170170
# Log the error but don't fail the entire request
171171
logger.warning("Failed to upload metadata to S3: %s", metadata_exc)

src/server/s3_utils.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def upload_to_s3(content: str, s3_file_path: str, ingest_id: UUID) -> str:
186186
}
187187

188188
# Log upload attempt
189-
logger.debug("Starting S3 upload", extra=extra_fields)
189+
logger.info("Starting S3 upload", extra=extra_fields)
190190

191191
try:
192192
# Upload the content with ingest_id as tag
@@ -226,7 +226,7 @@ def upload_to_s3(content: str, s3_file_path: str, ingest_id: UUID) -> str:
226226
public_url = f"https://{bucket_name}.s3.{get_s3_config()['region_name']}.amazonaws.com/{s3_file_path}"
227227

228228
# Log successful upload
229-
logger.debug(
229+
logger.info(
230230
"S3 upload completed successfully",
231231
extra={
232232
"bucket_name": bucket_name,
@@ -283,7 +283,7 @@ def upload_metadata_to_s3(metadata: S3Metadata, s3_file_path: str, ingest_id: UU
283283
}
284284

285285
# Log upload attempt
286-
logger.debug("Starting S3 metadata upload", extra=extra_fields)
286+
logger.info("Starting S3 metadata upload", extra=extra_fields)
287287

288288
try:
289289
# Upload the metadata with ingest_id as tag
@@ -325,7 +325,7 @@ def upload_metadata_to_s3(metadata: S3Metadata, s3_file_path: str, ingest_id: UU
325325
)
326326

327327
# Log successful upload
328-
logger.debug(
328+
logger.info(
329329
"S3 metadata upload completed successfully",
330330
extra={
331331
"bucket_name": bucket_name,
@@ -371,7 +371,7 @@ def get_metadata_from_s3(s3_file_path: str) -> S3Metadata | None:
371371
# Object doesn't exist if we get a 404 error
372372
error_code = err.response.get("Error", {}).get("Code")
373373
if error_code == "404":
374-
logger.debug("Metadata file not found: %s", metadata_file_path)
374+
logger.info("Metadata file not found: %s", metadata_file_path)
375375
return None
376376
# Log other errors but don't fail
377377
logger.warning("Failed to retrieve metadata from S3: %s", err)
@@ -474,7 +474,7 @@ def get_s3_url_for_ingest_id(ingest_id: UUID) -> str | None:
474474
logger.debug("S3 not enabled, skipping URL lookup for ingest_id: %s", ingest_id)
475475
return None
476476

477-
logger.debug("Starting S3 URL lookup for ingest ID", extra={"ingest_id": str(ingest_id)})
477+
logger.info("Starting S3 URL lookup for ingest ID", extra={"ingest_id": str(ingest_id)})
478478

479479
try:
480480
s3_client = create_s3_client()
@@ -499,7 +499,7 @@ def get_s3_url_for_ingest_id(ingest_id: UUID) -> str | None:
499499
target_ingest_id=ingest_id,
500500
):
501501
s3_url = _build_s3_url(key)
502-
logger.debug(
502+
logger.info(
503503
"Found S3 object for ingest ID",
504504
extra={
505505
"ingest_id": str(ingest_id),
@@ -510,7 +510,7 @@ def get_s3_url_for_ingest_id(ingest_id: UUID) -> str | None:
510510
)
511511
return s3_url
512512

513-
logger.debug(
513+
logger.info(
514514
"No S3 object found for ingest ID",
515515
extra={
516516
"ingest_id": str(ingest_id),

0 commit comments

Comments
 (0)