There are a multitude of methods for setting configuration variables, with varying scopes.
As log_statement
is a superuser-only setting, you can rule out all of the client-side options, and the server- or database-wide settings are presumably too broad for your case.
I believe this only leaves you with the per-user option, i.e.:
ALTER USER interactive_user SET log_statement = 'all';
Or if it makes things easier to manage:
ALTER SYSTEM SET log_statement = 'all';
ALTER USER application_user SET log_statement = 'none';
Note that these settings are only applied on connection, so they cannot be triggered (or bypassed) via SET ROLE
commands.
Of course, this all assumes that your application and your interactive users aren't sharing logins, but I don't think there's anything else with the right level of granularity.