|
12 | 12 |
|
13 | 13 | from apps.etl.models import ExtractionData, PyStacLoadData, Transform
|
14 | 14 | from apps.etl.utils import read_file_data
|
| 15 | +from main.logging import log_extra |
15 | 16 | from main.managers import BulkCreateManager
|
16 | 17 |
|
17 | 18 | logger = logging.getLogger(__name__)
|
@@ -45,7 +46,7 @@ def transform_event_data(event_extraction_data):
|
45 | 46 | transform_obj.status = Transform.Status.SUCCESS
|
46 | 47 | transform_obj.save(update_fields=["status"])
|
47 | 48 | except Exception as e:
|
48 |
| - logger.error("Gdacs transformation failed", exc_info=True, extra={"extraction_id": gdacs_instance.id}) |
| 49 | + logger.error("Gdacs transformation failed", exc_info=True, extra=log_extra({"extraction_id": gdacs_instance.id})) |
49 | 50 |
|
50 | 51 | transform_obj.status = Transform.Status.FAILED
|
51 | 52 | transform_obj.save(update_fields=["status"])
|
@@ -109,7 +110,7 @@ def transform_geo_data(geo_data_extraction_id, event_extraction_id):
|
109 | 110 | transform_obj.save(update_fields=["status"])
|
110 | 111 |
|
111 | 112 | except Exception as e:
|
112 |
| - logger.error("Gdacs transformation failed", exc_info=True, extra={"extraction_id": gdacs_instance.id}) |
| 113 | + logger.error("Gdacs transformation failed", exc_info=True, extra=log_extra({"extraction_id": gdacs_instance.id})) |
113 | 114 |
|
114 | 115 | transform_obj.status = Transform.Status.FAILED
|
115 | 116 | transform_obj.save(update_fields=["status"])
|
@@ -152,7 +153,7 @@ def transform_impact_data(event_data):
|
152 | 153 | transform_obj.status = Transform.Status.SUCCESS
|
153 | 154 | transform_obj.save(update_fields=["status"])
|
154 | 155 | except Exception as e:
|
155 |
| - logger.error("Gdacs transformation failed", exc_info=True, extra={"extraction_id": gdacs_instance.id}) |
| 156 | + logger.error("Gdacs transformation failed", exc_info=True, extra=log_extra({"extraction_id": gdacs_instance.id})) |
156 | 157 |
|
157 | 158 | transform_obj.status = Transform.Status.FAILED
|
158 | 159 | transform_obj.save(update_fields=["status"])
|
|
0 commit comments