I don’t think the only factor considered is whether or not something is PII, rather even the intent is considered.
If you were storing IP addresses to track and market to users, you need consent.
If you’re using them for logging and security purposes, I think that falls under legitimate interest.