Lazy Q: Is there a way to get Lucee to keep its lo...
# lucee
a
Lazy Q: Is there a way to get Lucee to keep its log entries to one line, rather than just spewing raw stack traces (etc) into the logs over hundreds of log lines?
z
you want no stack?
a
the stack traces are fine. But the linebreaks should be escaped in the log entry, I think.
z
Example?
a
Well... agree with DASH-1436 that it's probably not useful information for a 404. Why is Lucee even logging a 404 anyhow? That's the web server's job, if anything.
z
I did a look or of work parsing this for my logviewer plugin
a
Yeah see a log viewer can unescape the line breaks in the log entry if that what it needs to do. But the entry in the file should only be one line, right?
z
theory is if it reaches lucee, lucee should log the error. it doesn't need a stack IMHO
a
^^ Re webserver logging web server wouldn't know if its just proxying to lucee. I think not having a stack on a 404 would be desirable
a
Lucee will respond to the web server saying "didn't find that", so the web server should know. It's its job.
That aside, a 404 is not a server error; it's a client error. So there shouldn't even be a stack trace to output. Anyway, not relevant to this thread.
a
Yeah given a route to a dynamic resource it’s probably more likely an application error, gives me the shits when app returns a 404 when it really means 403 or 500
Unless security by obscurity I don’t want to give you a hint that there is a route for you to find here
b
It should be possible to change the appender and/or appender layout to accomplish this.
I did some work in CommandBox recently to allow any appender layout to be chosen for the CommadBox server logs, allowing formats such as the elastic search ingestible JSON format.
⭐ 1
I doubt Lucee is directly exposing the appender layout however, so either Lucee would need to stat doing that, or there maybe some env vars Log4j picks up out of the box. There's a bunch of stuff you can configure via env vars/sys props, but I've always found the docs on them to be hard to find.
If Lucee has a specific log4j config file somewhere you can edit that would work, but I'm not sure if Lucee configures Log4j programmatically or via a file. Prolly the former given its own layer of logger config.
a
Gotcha. I was kinda expecting it to be along those lines.