Use String.valueOf() instead. It's more robust against Object values in the MDC.