{"record":{"id":"314bdc484427abe0","repo":"apereo/cas","slug":"logger-warn-message-throwable-or-summarized-sta","errorCode":null,"errorMessage":"logger.warn(message, throwable) (or summarized stack trace)","messagePattern":"logger\\.warn\\(message, throwable\\) \\(or summarized stack trace\\)","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":151,"sourceCode":"\n    /**\n     * Log warning.\n     *\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();","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/LoggingUtils.java#L133-L169","documentation":"LoggingUtils.warn(Logger, String, Throwable) decides per-logger whether to log the full stack trace or a summarized one via LOG_MESSAGE_SUMMARIZER. When summarization is off (shouldSummarize false), the ordinary logger.warn(message, throwable) path executes, printing the full trace. This entry covers the non-summarized branch of that warning log.","triggerScenarios":"Calling LoggingUtils.warn(logger, msg, t) where the log message summarizer is configured not to summarize for that logger, so the complete stack trace is emitted at WARN level.","commonSituations":"Production logs flooded by full traces of expected/recoverable exceptions; teams trying to shrink log volume deciding whether to enable stack-trace summarization for WARN events.","solutions":["Fix the condition producing the exception so the warn stops","If log volume is the concern, enable stack-trace summarization (LOG_MESSAGE_SUMMARIZER) so traces are collapsed","Filter or route this logger category in your log aggregation config if traces are expected noise"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Decide per-environment whether full traces or summaries belong in WARN logs","Fix root causes rather than living with recurring full-trace warns","Configure log volume limits in aggregation to absorb trace-heavy warns"],"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"}