postgresql – Writing custom server logs in Postgres

We have set up a Postgres instance that is writing logs directly to AWS CloudWatch. We would like to be able to write our own logs for the purpose of automated processing. Unfortunately our current experiments seemed to generate logs only on the client (caller) side:

CREATE or replace FUNCTION logInfo() RETURNS void AS $$
    BEGIN
       raise notice 'Hello World!';
       raise info 'Hello World!';
    END;
$$ LANGUAGE plpgsql;

select logInfo();

Is there a way to write logs on the server side too?