Hi all! I recently updated the docker image (comm...
# lucee
s
Hi all! I recently updated the docker image (commandbox:jdk11-3.7.4) and lucee version (lucee@5.3.10+120) I'm using for my app and just realized that, now, every single query is being logged to
/usr/local/lib/serverHome/WEB-INF/lucee-web/datasource.log
. (Severity = "INFO" where before it was "ERROR") I'm not sure if updating the docker image had anything to do with it but it doesn't look like I changed anything in the code; figured this might be a LogBox setting in my Coldbox.cfc but nothing's jumping out at me. Where should I look?
b
If you didn't set it with CFConfig, then Lucee likely changed its default behavior
Either wait, use CFConfig to set the logger level to whatever you want.
LogBox has nothing to do with this. That log file is part of Lucee.
@Sam Scott
s
Thanks, Brad! So I brought up a shell in my docker image and started commandbox. Running
cfconfig show
gives me all the settings. I see a loggers struct with appenders defined but where would the logging level be set?
b
The logger setting you want are likley in the web context
So you want to run
Copy code
cfconfig show fromFormat=luceeWeb
That said, it doesn't necessarily answer the question I asked, but it may be interesting
If you want to see what Lucee's settings are, you can simply log into the web admin!
s
That's what I'm doing now... I'll poke around and find it. thanks for your help!
b
I'm not entirely sure what it is you're currently looking for
You already said in your original post that the log level was set to "info", so I assume you've already found this information
What else exactly were you expecting to find in CFConfig?
When I asked if you were setting the logger's severity, I meant if you specifically were providing a CFConfig JSON file or a CFConfig env var which set that explicitly
I didn't mean for you to use CFConfig to look at the current setting, since it appears you already know the current setting 🙂
If you're wanting to determine if Lucee changed the default, then I'd inspect the XML files that come stock in the Lucee CF engine on forgebox (before a server is ever started with them) and see if they include any config for that logger
s
no worries... i don't really know what I'm looking for or what changed or why all the sudden all queries are being logged. I just need it to stop. 😉
b
Ok, well then set it to what you want with CFConfig and that's it lol 🙂
s
right, but where do I find the exact key name for what to set? I assume the value will be "ERROR"? Or, a number from 0 to 4, maybe?
b
The JSON format would prolly be something like
Copy code
{
  "loggers": {
    "datasource": {
      "appender": "resource",
      "appenderArguments": {
        "path": "{lucee-config}/logs/datasource.log"
      },
      "layout": "classic",
      "level": "error"
    }
  }
}
Or you could try an env var such as
Copy code
cfconfig_loggers_datasource_level=error
but I don't recall off the top of my head if you can just set part of the info for a logger
Looking at
WEB-INF\lib\lucee.jar\core\core.lco\resource\config\web.xml
inside of a Lucee 5.3.10.120 war, I don't see any logger config in there.
Now, it's possible Lucee's internal defaults (when not set in the XML) changed between versions
There was actually a bug fixed recently in Lucee which was preventing error severities other than error from ever being logged if I recall. That could have also be why you didn't see these messages before.
What version of LUcee were you on previously?
s
So, that's what's weird, too... When i reverted back to an old docker image with lucee@5.3.4+80 the logging level was back to error. however, I tried building an image with the same lucee@5.3.4+80 and the logging level was still info. ??
no, sorry... that was lucee5-3.0.2
b
It makes a difference which docker tag you're on
Some of them already have the Lucee home warmed up and others are basically blank and when you start the container, Lucee expands everything for the first time
I would take your base image, start it up with a custom CMD of just
bash
(so no server starts) and look at the lucee-web.xml file to see if any logger settings are already in place
s
OK, so your environment variable did the trick...
Copy code
cfconfig_loggers_datasource_level=error
✅ 1
But I am curious so I will spin up a base image and take a look at that lucee-web.xml as you suggest. Once again, thanks for all your help! I'm busy running a business and only dive into this stuff only every few months or so.
b
Yep, good luck tracking it down 🙂