Possibly illegal?
I'd posit that it's definitely illegal. Surely it comes under either interception of communications - if you log every keystroke you have the contents of emails etc. - or computer misuse i.e. fucking with someone's machine without consent, or perhaps a double-whammy of both. I'd say they're screwed.