Adding code to cap the stderr file as well based on configuration.