Logging module what allow /logstart and /logstop command on channel or private messages. Each channel goes to different file.
Also usefull command is somekind /logfind logfile [lastrows N] regexp string what allows search rows from log with client.
I think that search function need to be threaded and include somekind timeout because I dont want that normal users can kill bouncer with loo slow querys.
I don't think anyone of us will writing something as complicated as this, sorry. Also, this sounds like people could abuse it (just join #ubuntu, wait a week and then make znc grep through the result repeatedly).