Skip to content

Commit

Permalink
Merge pull request #136 from pagopa/PAGOPA-2299-opt-log
Browse files Browse the repository at this point in the history
feat: [PAGOPA-2299] opt log: update log conf
  • Loading branch information
alessio-acitelli authored Oct 18, 2024
2 parents a06cd98 + 644ce8a commit 94e5a0c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
12 changes: 8 additions & 4 deletions host.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
}
},
"logging": {
"fileLoggingMode": "always",
"fileLoggingMode": "debugOnly",
"logLevel": {
"default": "Information",
"default": "None",
"Host.Results": "Error",
"Function": "Information",
"Host.Aggregator": "Trace"
"Function.BizEventToReceiptProcessor": "Information",
"Function.CartEventToReceiptProcessor": "Information",
"Microsoft": "Information",
"Worker": "Information",
"Host.Aggregator": "Error",
"Host": "Error"
},
"applicationInsights": {
"samplingSettings": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void processBizEventToReceipt(

Receipt receipt = BizEventToReceiptUtils.createReceipt(bizEvent, bizEventToReceiptService, logger);

logger.info("[{}] function called at {} for event with id {} and status {}",
logger.debug("[{}] function called at {} for event with id {} and status {}",
context.getFunctionName(), LocalDateTime.now(), bizEvent.getId(), bizEvent.getEventStatus());

if (isReceiptStatusValid(receipt)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void run(
listOfFailedReceipt.add(receipt);
}
cartForReceipt.setStatus(CartStatusType.SENT);
logger.info("[{}] Cart with id {} processes successfully. Cart with status: {} and receipt with status: {}",
logger.debug("[{}] Cart with id {} processes successfully. Cart with status: {} and receipt with status: {}",
context.getFunctionName(), cartForReceipt.getId(), cartForReceipt.getStatus(), receipt.getStatus());
} else {
logger.error("[{}] Failed to process cart with id {}: fail to save receipt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ public static boolean isBizEventInvalid(BizEvent bizEvent, ExecutionContext cont
return true;
}

// logger.info("[{}] event with id {} discarded because in status {}", context.getFunctionName(), bizEvent.getId(), bizEvent.getEventStatus());

if (!BizEventStatusType.DONE.equals(bizEvent.getEventStatus())) {
logger.debug("[{}] event with id {} discarded because in status {}",
context.getFunctionName(), bizEvent.getId(), bizEvent.getEventStatus());
Expand Down

0 comments on commit 94e5a0c

Please sign in to comment.