Missing quote = 1 GB Catalina log file

#1

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
#2

Yeah, full stack traces aren’t great in production

#3

So, how do I change that?

#4

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

#5

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
#6

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.