From 837c36dbd591645c9c512a24152080c98a1ed124 Mon Sep 17 00:00:00 2001 From: Basilio Bogado <541149+basiliskus@users.noreply.github.com> Date: Tue, 5 Dec 2023 14:39:49 -0800 Subject: [PATCH] Added info logging when saving --- .../AzureStorageAccountPartnerMetadataStorage.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/azure/AzureStorageAccountPartnerMetadataStorage.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/azure/AzureStorageAccountPartnerMetadataStorage.java index 15a4c2b84..6a7644fb8 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/azure/AzureStorageAccountPartnerMetadataStorage.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/azure/AzureStorageAccountPartnerMetadataStorage.java @@ -7,8 +7,10 @@ import gov.hhs.cdc.trustedintermediary.context.ApplicationContext; import gov.hhs.cdc.trustedintermediary.etor.metadata.PartnerMetadata; import gov.hhs.cdc.trustedintermediary.etor.metadata.PartnerMetadataStorage; +import gov.hhs.cdc.trustedintermediary.wrappers.Logger; import java.io.ByteArrayInputStream; import java.nio.charset.StandardCharsets; +import javax.inject.Inject; /** Implements the {@link PartnerMetadataStorage} using files stored in an Azure Storage Account. */ public class AzureStorageAccountPartnerMetadataStorage implements PartnerMetadataStorage { @@ -27,6 +29,8 @@ public class AzureStorageAccountPartnerMetadataStorage implements PartnerMetadat private static final AzureStorageAccountPartnerMetadataStorage INSTANCE = new AzureStorageAccountPartnerMetadataStorage(); + @Inject Logger logger; + private AzureStorageAccountPartnerMetadataStorage() {} public static AzureStorageAccountPartnerMetadataStorage getInstance() { @@ -45,5 +49,14 @@ public void saveMetadata(final PartnerMetadata metadata) { ByteArrayInputStream inputStream = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)); blobClient.upload(inputStream, content.length(), true); + logger.logInfo( + "Saved metadata for " + + metadata.uniqueId() + + " to " + + METADATA_CONTAINER_NAME + + " container in " + + STORAGE_ACCOUNT_BLOB_ENDPOINT + + " Azure storage account" + + blobClient.getBlobUrl()); } }