I am trying to setup logging on ubuntu server 20.04.4 using ufw, but I'll take non-ufw advice as well.
I am running a test https server on port 20000 and want to log all connections to it. Here's what I did.
ufw allow log-all 20000/tcp
Here's my ufw status:
To Action From
-- --------- -----
20000/tcp ALLOW IN Anywhere (log-all)
Now the only records I see in my log file (/var/log/ufw.log) are the "blocks" being generated from other rules. I am able to connect to the server from outside, and my test server runs fine (*delivers the content I need*). But I just don't see any records pertaining to this rule in ufw logs.
What might I be missing?
Edit 1: Since I cannot comment yet, I am reacting to @mashuptwice's advice here.
My ufw logging is on (low).
If I did
ufw logging medium
wouldn't that apply to all rules? I only need extra logging for this specific rule.
Asked by Dr Phil
(139 rep)
Feb 28, 2022, 03:39 PM
Last activity: Jul 19, 2025, 01:04 PM
Last activity: Jul 19, 2025, 01:04 PM