add feature to control buffered log, include filter and buffer cap

Just a suggestion but it looks like there's scope here for factoring out some common code.