apereo/cas · warning

logger.warn(message, throwable) (or summarized stack trace)

Error message

logger.warn(message, throwable) (or summarized stack trace)

What it means

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.

Solutions

  1. Fix the condition producing the exception so the warn stops
  2. If log volume is the concern, enable stack-trace summarization (LOG_MESSAGE_SUMMARIZER) so traces are collapsed
  3. Filter or route this logger category in your log aggregation config if traces are expected noise
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apereo/cas@e7288fc434 (2026-09-08). Data as JSON: /api/errors/314bdc484427abe0. Report an issue: GitHub.

Appendix: source

Thrown at core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/LoggingUtils.java:151

    /**
     * Log warning.
     *
     * @param logger    the logger
     * @param throwable the throwable
     */
    public static void warn(final Logger logger, final Throwable throwable) {
        warn(logger, getMessage(throwable), throwable);
    }

    /**
     * Log warning.
     *
     * @param logger    the logger
     * @param message   the message
     * @param throwable the throwable
     */
    public static void warn(final Logger logger, final String message, final Throwable throwable) {
        FunctionUtils.doIf(LOG_MESSAGE_SUMMARIZER.shouldSummarize(logger),
                _ -> logger.warn(LOG_MESSAGE_SUMMARIZER.summarizeStackTrace(message, throwable)),
                _ -> logger.warn(message, throwable))
            .accept(throwable);
    }

    /**
     * Get first non-null exception message, and return class name if all messages null.
     *
     * @param throwable Top level throwable
     * @return String containing first non-null exception message, or Throwable simple class name
     */
    public static String getMessage(final Throwable throwable) {
        if (StringUtils.isEmpty(throwable.getMessage())) {
            val message = ExceptionUtils.getThrowableList(throwable)
                .stream().map(Throwable::getMessage).filter(Objects::nonNull).findFirst();
            if (message.isPresent()) {
                return message.get();

View on GitHub (pinned to e7288fc434)