private String preventLogForging ( String logMsg ) { String result = logMsg ; // use precompiled pattern for performance reasons result = LINEBREAK_PATTERN . matcher ( logMsg ) . replaceAll ( SingleLinePatternLayout . LINE_SEP ) ; return result ; }
Method to prevent log forging .