Changed log level to warn on publish not 200-OK and added HTTP result code to message

This commit is contained in:
Mauro Mugnaini 2020-06-24 18:49:50 +02:00
parent 9f56248a54
commit 9eb4ad8bf7
1 changed files with 2 additions and 2 deletions

View File

@ -99,10 +99,10 @@ public class HTTPEventSender implements EventSender {
br.close();
if (ok) {
if (log.isDebugEnabled()) {
log.debug("Event publish OK. Results: " + sb.toString());
log.debug("[" + httpResultCode + "] Event publish OK. Results: " + sb.toString());
}
} else {
log.error("Event publish KO. Results: " + sb.toString());
log.warn("[" + httpResultCode + "] Event publish is not OK. Results: " + sb.toString());
}
} catch (Exception e) {
log.error("POSTing JSON to: " + endpoint, e);