private void logError(String msg) {
    logDurations();
    logMessage.append(msg);
    structuredLogMessage.put("error", msg);

    if (publicAccessLogger.structuredLoggingEnabled()) {
      publicAccessLogger.logError(structuredLogMessage);
    } else {
      publicAccessLogger.logError(logMessage.toString());
    }
  }
Logs error message
@param msg the message to log
ambry-rest/src/main/java/com/github/ambry/rest/PublicAccessLogHandler.java