Raising ufw logging to medium or high logs a lot of traffic you don’t care about. To see who uses one port, add logging to that one rule.
Put log after the action:
sudo ufw allow log 22/tcp
sudo ufw allow log-all from 192.0.2.50 to any port 5432 proto tcp
log writes a line for each new connection that matches, so every SSH login attempt appears once. log-all logs every packet of the rule, which I’d keep for short debugging sessions, because a busy connection fills the log quickly.
The lines go to the kernel log with the prefix [UFW ALLOW], so you can follow them with:
sudo journalctl -k -f | grep 'UFW ALLOW'
On Ubuntu they also land in /var/log/ufw.log through rsyslog.
To add logging to an existing rule, you have to replace it: ufw delete the old one and add the new one with log. Since a new rule is appended at the end, check ufw status numbered to make sure it doesn’t end up below a deny rule that matches first.
Further reading: ufw(8) manual page