Missing quote = 1 GB Catalina log file

Accidentally did this (missing quotes around the attribute storing inside the parentheses)

<cfif FileExists(#application.app.directoryImages##numberFormat(#session.org.ID#,'0')#/#session.org.logoFile#)>

instead of (with quotes):

<cfif FileExists("#application.app.directoryImages##numberFormat(#session.org.ID#,'0')#/#session.org.logoFile#")>

And the /opt/tomcat/logs/cataling.out log file hit 1.04 GB

Now, I’m not asking Lucee or CF to fix sloppy code. But, I don’t think it should cause 1 GB log files.

1 Like

Yeah, full stack traces aren’t great in production

So, how do I change that?

Run a cronjob or scheduled task to truncate the log files or install and configure logrotate.

I check logs regularly and they do rotate. However, this happened in about 5 seconds, it went from under 100k to over 1.04 GB simply because of missing quotes. Seems to me that Lucee shouldn’t react that way?

1 Like

I wouldn’t think it was buggy code, just the cold efficiency of computing.

You said you wanted YY
Computer delivered YY
You decided you didnt want YY
Instead you wanted XX
You changed your order to XX
Computer now delivers XX

The way the computing world works is, its not the computers fault if it delivers a result you didn’t expect. You just didn’t ask specifically enough for what you want. At least that’s my opinion after over a few decades of developing.