"The processing of personal data for direct marketing purposes may be regarded as carried out for a legitimate interest."
It's also mentioned in Article 21 describing the right to object to processing using legitimate/public interest:
"Where personal data are processed for direct marketing purposes, the data subject shall have the right to object at any time… etc."
The ICO has some useful guidance on when it is an appropriate basis: https://ico.org.uk/for-organisations/guide-to-data-protectio...
for example for Nginx something like:
log_format logfmt '$remote_country - [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_generic_user_agent" "$gzip_ratio"';
That would assume access to a GeoIP database, but it would be helpful.
A similar idea would be to have built-in $remote_addr_hash8, $remote_addr_hash16 variables which hash IPv4 and IPv6 addresses down to 8-bit or 16-bit numbers.
There are hacky ways you can do some forms of anonymization already:
https://www.supertechcrew.com/anonymizing-logs-nginx-apache/
Those who have the intent to comply and are at least complying in spirit are not at any legal risk. Attitude matters.
And the spirit is obvious: get consent if you enable a third party to unique identify a user in reality. I.e. if it's private data or if you enable correlation across websites.
It's correlating and sharing you need consent for. Don't worry about a server log.
It is not about what you make possible. It's about what you do. Technically any sysadmin can access some information they should not. It's unavoidable.
But that's quite a far way from commercially exploiting databases of people without their consent.
Honestly they should just ban the sale of personal information. Most internet marketing vendors are not actually in the business of selling personal data.
Now the good ones suffer because of the bad ones. And the bad ones either pretend they have consent or find a way to get it.
It was good for privacy, not because it's enforced or not and not because sites are showing cookie consents, but because it made the public more aware of centralization/privacy issues on the internet and companies a bit more careful with data processing. This law also resulted in many "privacy-friendly" alternatives for various services, which in the end led to a healthier market and improved data decentralization.
This would mean any server-side analytics (looking at access logs, which include IP address and user-agent) cannot be used for analytics or tracking, since there is no way for a user to give/deny consent to a page that already has logged information on them.