Support log parsing for multi roles node case, small refactoring.