Cleaned codes and add some more debug output.  Refs #7459.
Fixed bug and add debug log. Refs #7459.
Merge remote-tracking branch 'origin/bugfix/7459_filter_log'