{"record":{"id":"e838af1065797e38","repo":"apereo/cas","slug":"logger-warn-message-throwable","errorCode":null,"errorMessage":"logger.warn(message, throwable)","messagePattern":"logger\\.warn\\(message, throwable\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/LoggingUtils.java","lineNumber":154,"sourceCode":"     *\n     * @param logger    the logger\n     * @param throwable the throwable\n     */\n    public static void warn(final Logger logger, final Throwable throwable) {\n        warn(logger, getMessage(throwable), throwable);\n    }\n\n    /**\n     * Log warning.\n     *\n     * @param logger    the logger\n     * @param message   the message\n     * @param throwable the throwable\n     */\n    public static void warn(final Logger logger, final String message, final Throwable throwable) {\n        FunctionUtils.doIf(LOG_MESSAGE_SUMMARIZER.shouldSummarize(logger),\n                _ -> logger.warn(LOG_MESSAGE_SUMMARIZER.summarizeStackTrace(message, throwable)),\n                _ -> logger.warn(message, throwable))\n            .accept(throwable);\n    }\n\n    /**\n     * Get first non-null exception message, and return class name if all messages null.\n     *\n     * @param throwable Top level throwable\n     * @return String containing first non-null exception message, or Throwable simple class name\n     */\n    public static String getMessage(final Throwable throwable) {\n        if (StringUtils.isEmpty(throwable.getMessage())) {\n            val message = ExceptionUtils.getThrowableList(throwable)\n                .stream().map(Throwable::getMessage).filter(Objects::nonNull).findFirst();\n            if (message.isPresent()) {\n                return message.get();\n            }\n        }\n        return StringUtils.defaultIfEmpty(throwable.getMessage(), throwable.getClass().getSimpleName());","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/LoggingUtils.java#L136-L172","documentation":"The full-trace branch of LoggingUtils.warn(Logger, String, Throwable) as at line 151 (same method, adjacent call-site entry): logger.warn(message, throwable) emits the complete stack trace at WARN when the summarizer decides not to summarize. Not an exception; it is the recorded warn event.","triggerScenarios":"Same as errorIndex 415: warn(logger, message, throwable) invoked with summarization disabled for that logger.","commonSituations":"Same as errorIndex 415; log-parsing pipelines may see this and the line-151 entry as duplicates of one warn event.","solutions":["Address the recoverable condition reported in the message/trace","Enable stack-trace summarization if full traces are bloating logs","Route or deduplicate this category in log aggregation if it recurs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Same as the full-trace warn path: resolve the underlying recoverable exception","Enable trace summarization in production if logs grow too large","Set alerting on repeated identical warn events to spot chronic issues"],"tags":["logging","stack-trace","warn"],"backgroundTag":"stack-trace-summarized","analyzedSha":"e7288fc434b4f4505b8452e1a57e8fb3111bb863","analyzedAt":"2026-09-08T15:39:16.015Z","contentChangedAt":"2026-09-08T15:39:16.015Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}