Skip to content

Commit

Permalink
[PAGOPA-2298] opt log: update conf
Browse files Browse the repository at this point in the history
  • Loading branch information
pagopa-github-bot authored and aacitelli committed Oct 17, 2024
1 parent 82a1d82 commit 137db55
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: pagopareceiptpdfgenerator
description: Microservice description
type: application
version: 0.146.0
appVersion: 1.13.3-1-PAGOPA-2017-fix-message-encoding
version: 0.147.0
appVersion: 1.13.4
dependencies:
- name: microservice-chart
version: 2.4.0
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-receipt-pdf-generator
tag: "1.13.3-1-PAGOPA-2017-fix-message-encoding"
tag: "1.13.4"
pullPolicy: Always
# https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.WebHost/Controllers/HostController.cs
livenessProbe:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-receipt-pdf-generator
tag: "1.13.3-1-PAGOPA-2017-fix-message-encoding"
tag: "1.13.4"
pullPolicy: Always
# https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.WebHost/Controllers/HostController.cs
livenessProbe:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-receipt-pdf-generator
tag: "1.13.3-1-PAGOPA-2017-fix-message-encoding"
tag: "1.13.4"
pullPolicy: Always
# https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.WebHost/Controllers/HostController.cs
livenessProbe:
Expand Down
13 changes: 9 additions & 4 deletions host.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@
}
},
"logging": {
"fileLoggingMode": "always",
"fileLoggingMode": "debugOnly",
"logLevel": {
"default": "Information",
"default": "None",
"Host.Results": "Error",
"Function": "Information",
"Host.Aggregator": "Trace"
"Function.GenerateReceiptProcess": "Information",
"Function.ManageReceiptPoisonQueueProcessor": "Information",
"Function.RetryReviewedPoisonMessagesProcessor": "Information",
"Microsoft": "Information",
"Worker": "Information",
"Host.Aggregator": "Error",
"Host": "Error"
},
"applicationInsights": {
"samplingSettings": {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>it.gov.pagopa.receipt</groupId>
<artifactId>receipt-pdf-generator</artifactId>
<version>1.13.3-1-PAGOPA-2017-fix-message-encoding</version>
<version>1.13.4</version>
<packaging>jar</packaging>

<name>pagopa-receipt-pdf-generator</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void processGenerateReceipt(
return;
}

logger.info("[{}] Generating pdf for Receipt with id {} and eventId {}",
logger.debug("[{}] Generating pdf for Receipt with id {} and eventId {}",
context.getFunctionName(),
receipt.getId(),
receiptEventReference);
Expand All @@ -179,7 +179,7 @@ public void processGenerateReceipt(
if (success) {
receipt.setStatus(ReceiptStatusType.GENERATED);
receipt.setGenerated_at(System.currentTimeMillis());
logger.info("[{}] Receipt with id {} being saved with status {}",
logger.debug("[{}] Receipt with id {} being saved with status {}",
context.getFunctionName(),
receipt.getEventId(),
receipt.getStatus());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void processManageReceiptPoisonQueue(
//attempt to Map queue bizEventMessage to BizEvent
listOfBizEvents = ObjectMapperUtils.mapBizEventListString(errorMessage, new TypeReference<>() {});
bizEvent = listOfBizEvents.get(0);
logger.info("[{}] function called at {} recognized as valid BizEvent with id {}",
logger.debug("[{}] function called at {} recognized as valid BizEvent with id {}",
context.getFunctionName(), LocalDateTime.now(), bizEvent.getId());
if (Boolean.TRUE.equals(bizEvent.getAttemptedPoisonRetry())) {
logger.info("[{}] function called at {} for event with id {} has ingestion already retried, sending to review",
Expand Down Expand Up @@ -151,7 +151,7 @@ private void saveToReceiptError(ExecutionContext context, String errorMessage, S
String encodedEvent = Aes256Utils.encrypt(errorMessage);
receiptError.setMessagePayload(encodedEvent);

logger.info("[{}] saving new entry to the retry error to review with payload {}",
logger.debug("[{}] saving new entry to the retry error to review with payload {}",
context.getFunctionName(), encodedEvent);
} catch (Aes256Exception e) {
receiptError.setMessageError(e.getMessage());
Expand All @@ -167,7 +167,7 @@ private void updateReceiptToReview(ExecutionContext context, String eventId,

receipt.setStatus(ReceiptStatusType.TO_REVIEW);

logger.info("[{}] updating receipt with id {} to status {}",
logger.debug("[{}] updating receipt with id {} to status {}",
context.getFunctionName(), receipt.getId(), ReceiptStatusType.TO_REVIEW);
receiptOutputBinding.setValue(receipt);
} catch (ReceiptNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void processRetryReviewedPoisonMessages(
private void updateReceiptToInserted(ExecutionContext context, String bizEventId) throws ReceiptNotFoundException, UnableToSaveException {
Receipt receipt = this.receiptCosmosService.getReceipt(bizEventId);
receipt.setStatus(ReceiptStatusType.INSERTED);
logger.info("[{}] updating receipt with id {} to status {}", context.getFunctionName(), receipt.getId(), ReceiptStatusType.INSERTED);
logger.debug("[{}] updating receipt with id {} to status {}", context.getFunctionName(), receipt.getId(), ReceiptStatusType.INSERTED);
this.receiptCosmosService.updateReceipt(receipt);
}
}

0 comments on commit 137db55

Please sign in to comment.