package <%=packageName%>.web.rest.util;

import org.springframework.http.HttpHeaders;

/**
 * Utility class for HTTP headers creation.
 *
 */
public class HeaderUtil {

    public static HttpHeaders createAlert(String message, String param) {
        HttpHeaders headers = new HttpHeaders();
        headers.add("X-<%=angularAppName%>-alert", message);
        headers.add("X-<%=angularAppName%>-params", param);
        return headers;
    }
<%
    if(enableTranslation) {
        var createdMessage = '"' + angularAppName + '." + entityName + ".created"';
        var updatedMessage = '"' + angularAppName + '." + entityName + ".updated"';
        var deletedMessage = '"' + angularAppName + '." + entityName + ".deleted"';
        var errorMessage = '"error." + errorKey';
    } else {
        var createdMessage = '"A new " + entityName + " is created with identifier " + param';
        var updatedMessage = '"A " + entityName + " is updated with identifier " + param';
        var deletedMessage = '"A " + entityName + " is deleted with identifier " + param';
        var errorMessage = 'defaultMessage';
    }
%>
    public static HttpHeaders createEntityCreationAlert(String entityName, String param) {
        return createAlert(<%- createdMessage %>, param);
    }

    public static HttpHeaders createEntityUpdateAlert(String entityName, String param) {
        return createAlert(<%- updatedMessage %>, param);
    }

    public static HttpHeaders createEntityDeletionAlert(String entityName, String param) {
        return createAlert(<%- deletedMessage %>, param);
    }

    public static HttpHeaders createFailureAlert(String entityName, String errorKey, String defaultMessage) {
        HttpHeaders headers = new HttpHeaders();
        headers.add("X-<%=angularAppName%>-error", <%- errorMessage %>);
        headers.add("X-<%=angularAppName%>-params", entityName);
        return headers;
    }
}

@@ -34,16 +34,73 @@
 .util;%0A%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A
 import o
@@ -219,16 +219,91 @@
 Util %7B%0A%0A
+    private final Logger log = LoggerFactory.getLogger(HeaderUtil.class);%0A%0A
     publ
@@ -1817,24 +1817,91 @@
 tMessage) %7B%0A
+        log.warning(%22Entity creation failed, %7B%7D%22, defaultMessage);%0A
         Http

add log statement in headerUtil.java