I have a different take than bkbk's reply today. Rather then being concerned about you causing "too many changes happening at the same time", my concern is that you are juggling (and making us all juggle) too many variables.
1) For example, you're showing cf as on Windows and Linux--with the latter being cf on Jboss as a war. I appreciate that you were making the point that the problem happens on both. But since War deployment of cf is niche (limited in number)--and on jboss specifically is still more niche--let's stick with discussing what you experience with CF on Windows, unless and until you really have need to make a distinction between the two variants. That will simplify things here.
1a) Second, your comments show running your Windows deployment of cf is as a cf instance called mywebapp. That was not indicated in your first post.
Indeed, I replied talking about how use of port 8500 implies your storing code in the cfusion/wwwroot, and you didn't correct me/us that you use /mywebapp/wwwroot. You simply showed using it in reply, and it's a subtle difference we had to discern. It might even be an important distinction: you'd definitely need to configure and look for things in different folders reflecting the correct instance. (And FWIW, your linux/jboss results then show you using cf's provided cfusion.war there, which I realize is the default war file name, but it could confuse matters for some trying to follow along.)
But perhaps more than important, when you show using port 8500, which was that on? Windows or Linux? Because when cf is installed as you have on Windows (NOT as a war), it defaults to using port 8500 for the cf admin and it uses the wwwroot (and logs) of the cfusion instance. Any new instance gets its own port, and a folder for the instance as a sibling to cfusion.
1b) So could you just discuss things simply in the context of Windows and perhaps do things only in your cfusion instance? This will both simplify things for us and also increase the chance for you that more people reading along can relate (since the number of folks running cf as multiple instances is a minority).
2) But most important, you're really throwing a curve ball with this whole matter of your java logging. And I get it: it's fundamental to what you want to do. But in the course of trying to understand how things are different for you since the move from CF2018 to cf2021, you've introduced not only the variety of differences I've relayed here, but it seems you're especially wanting to understand how 404 handling differs for you between cf2021 and 2018...and that on top of your own Java-based logging. Again, it's just too many variables.
2a) I'd strongly suggest you reduce your testing to one thing: in a stock deployment of cf2021 (on windows, in the cfusion/wwwroot, using port 8500),what happens for you when you run your 4 base scenarios?
Then introduce different variables, like adding a cflog, or adding your custom tag, or modifying any cf xml files. Then perhaps later try using a different instance.
Perhaps by starting from that "back to square one" approach, something may be more clear to you. Or it may be more clear to us.
3) Finally, I caught one key point you made, that the logging of things differed based on when you had or had not "logged in". That's certainly interesting, and you may want to elaborate on that.
Perhaps that's even possibly the most important point for you--but it's being lost in a flood of other concerns (and competing variables) being raised here.
Please make your testing as simple as possible. You may even find the answer on your own, suddenly. 🙂
... View more