Can OpenWrt Do it?

Script it and see. Take a look at ulogd and the Linux firewall logging.

(Well, $5 is about what an SoC in one of these devices cost -- that's why I said "Hardware is going to be your limitation")