Optimize logs loading and filtering in the log window. Closes #3669.