Add ability to automatically import settings into LuceeWeb
When Commandbox starts up a server, it looks to the server.json file to tell cfconfig to load the settings into Lucee. The problem here is that it imports it into the lucee Server scope rather than Lucee Web scope that is what is generally needed (for example logs dont take server settings by default)
As a suggestion/enhancement to the startup listener, maybe add the ability in the server.json file to set where they go, for example, instead of just this:
Maybe something like this can also be supported:
Sorry, I never saw your previous comment. That’s no a bad idea. Originally, I had thought about finding a way to bundle both web and server context settings in the same file. I could still do that, but I just never warmed up to the idea.
Maybe this would be too “magic”, but how would you feel about a pull request to commandbox-cfconfig that checks for the existence of a “-web” cfconfig file alongside the server cfconfig file (e.g. .cfconfig.json and .cfconfig-web.json), and if it is there, and the server is a Lucee server, it imports that into the web context? I am thinking it could go into the interceptor right where you import a .cfconfig.json password into the Lucee web context in addition to the server context if the server is a lucee server.
Adding my vote to this. We'd like to set our logs write to the console for Docker containers. Lucee, for whatever reason, looks to the web-context for these, instead of the server-context. So, while CFConfig handles the server-context setting fine, web-context logs don't actually get written to the console.
That defo seems like a bug in Lucee. Not that this ticket may have other uses, but it seems like this is mostly a workaround for Lucee not respecting server context log settings. I'd be curious to hear Micha weigh in on this.
Usually the server settings take priority except it seems log file settings don’t (or at least in my testing) so for example if we try and setup dB logging it goes to the server and doesn’t trigger as the web is still logging to file.