You can log IP addresses if there is a legitimate use for them. You just need to ensure that they are protected and that you do not keep them for any longer than is necessary (= use logrotate).
Logging them by default is a silent opt-in to a scenario where you are legally obligated to protect data you may not even know exists.
Anyone whose software logs IPs by default should stop, so that the admins who choose to log IPs must voluntarily choose to log protected information and handle it appropriately.
The GDPR has really made me think about minimising the collection of data that I don't need - absolutely a good thing.