There is an Spring global @ExceptionHandler(Exception.class) method which logs exception like that:
@ExceptionHandler(Exception.class)
void handleEx
If you are using Logback use the replace function in your logback config pattern
original pattern
%d %level %logger : %msg%n
with replace
%d %level %logger : %replace(%msg){'[\r\n]', '_'} %n
if you want to strip tag as well
%d %-5level %logger : %replace(%msg){'[\r\n]|<script', '_'} %n
This way you dont need to to modify individual log statements.