Problem/Motivation
I have several dozen hostnames that can be used across all my environments. My live site alone has at least half-a-dozen, from three different base domains. Some of these are proxied and some aren't. My log is littered with unnecessary "Request came through without being routed through CloudFlare" warnings, and if any of those warnings are actually legit, I can't tell, because the error message doesn't give me enough information about what triggered it.
Proposed resolution
- At a minimum, error messages should include the URL being accessed and the clients IP address, like you'd get with a 403 or 404 error.
- Allow users to specify the specific hostname(s) they want tracked. Perhaps a textarea that can be used either as a whitelist or a blacklist, which I've seen implemented in other contexts throughout Drupal's UI.
- Provide an option to suppress warnings for all authenticated users, so we don't have to rely on editors using an alternate hostname.
User interface changes
The attached image shows a possible UI.

| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 2023-10-25_06-18.png | 29.3 KB | scott_euser |
| Screen Shot 2023-05-05 at 11.23.19 AM.png | 107.73 KB | jstoller |
Issue fork cloudflare-3358559
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
scott_euser commentedUpdating title, actually going through the code there is nothing else to suppress other than bypass error logging. Will similarly make the field names and labels reflect that.
Similarly I do not think its a huge ask for a site builder to specify the domains to restrict suppressing the error message for. Leaving blank for all means a config override can be added like the below to settings.local.php for local development for example.
Similarly could be wrapped in a more dynamic statement to have it bypassed on non-live hosts that automatically spin up environments like using PANTHEON_ENVIRONMENT for instance.
Comment #5
scott_euser commentedComment #6
scott_euser commentedHere are the form inputs shown in the attached MR. The hostnames is conditional (form #states) on the suppress checkbox being checked.
Comment #8
andreastkdf commentedThe last commit is a re-roll for 2.0.x - merged 2.0.x and fixed conflicts. Pls ignore the other previous ones showing here, they are wrong, I've done a force reset, so the MR on git is ok and only showing my merge/fix conflicts commit.
Comment #9
pasive commentedAs a side note to avoid other warnings the use of this MR requires a Database update and correct export of cloudflare config.
Pay a special attention to behaviour when use config split module.
I don't know how to push to this branch to resolve pipeline issues with phpcs and etc.
Comment #10
scott_euser commentedThanks for your comment
The pipeline issues are part of the main branch and unrelated to this: https://git.drupalcode.org/project/cloudflare/-/pipelines - this does not introduce new issues, so that should be resolved elsewhere.
The fact that update hooks update config is expected, you can read more on that here: https://www.drupal.org/node/2535454
If the issue itself is resolved for you (ie, no more flooded logs) after using the merge request, perhaps you could mark it as 'Reviewed & tested by the community' to help progress the issue.
Thanks!
Comment #11
pasive commentedDone - reviewed!
Thanks for advice.
Comment #12
rosk0Needs work for:
A more details review would follow up once above is done and the merge request pipeline is green.
Comment #13
scott_euser commentedUnable to retest because of #3362051: Remove Cloudflare SDK dependency due to lack of maintenance but resolved conflicts. Its stored as a string so left as a string not sequence. Or do you want to split the textarea prior to save and recombine when setting default value?