(duplicated from the Lucee subchannel on the CFML slack @ @Zackster’s suggestion):
Hi I have a log file I am writing to just with writeLog(file="mylogfile"...). This log is not configured in Lucee Admin at all, so it should have no log rotation going on.
However I just checked and it looks like Lucee has rotated it: there is a mylogfile.log.1 in the log dir now.
I also can’t see what the rules for the rotation are. The file is 2128078 bytes, which is not a unit of MB, and it’s been rotated in the middle of the afternoon (rather than across the end of the day or something).
Can I please get some clarification as to what’s up here? We really don’t want that log rotated by Lucee… all that is already in hand via another mechanism.
I think a default behaviour of [doing anything] with the log file is maybe questionable, but so be it I guess.
I still don’t understand how we’d get a log file rotation kicking in @ 2MB when the default is 10MB.
Also given it’s the act of adding a log entry that grows the file, that is when the check of whether it’s time to rotate should occur, right? Not when “a logfile resourceAppender is created”, which would… I’m guessing… only occur the once for the lifetime of the server? I presume it’s something that happens when the first call to log to a given log is made? This sounds like a bug to me, based on what you say & me inferring from there.
But if a log is going to default to rotating every 10MB and have a max of ten files. How do I disable that? Or would it be a matter of setting the max size to [very large value] and, the max files to be 1? Does 1 for max files mean “log file plus one” or “just the log file and that’s it. Don’t rotate”. Or if I did that, would Lucee actually clear the main log file when it got full, so as to respect the max size? I can probably test that part myself (which I will do, and report back).
Well yeah to do the “[very large value] and, the max files to be 1” I’d need to add some config to it anyhow. Can’t do it via the admin (because it’s 2022 if for no other reason), but the Administrator object route (as per Adam Cameron's Dev Blog: Lucee: Creating a log file programmatically) will work, provided I can coerce the correct settings.