Most RDBMS have auditing features these days. Unless there's a lot of complex logic on the client that's sufficient. Otherwise yes, there are plenty of libraries and services for collecting and analyzing logs these days. I've looked at streaming Java Flight Recorder logs too, but it's probably overkill.
How do you suggest achieving this in desktop apps? Some kind of log streaming?