Copy link to clipboard
Copied
Hi,
How can we get cflog files created per day?
Thank you.
I don't think you have any control over the built-in log rolling functionality.
Dave Watts, Eidolon LLC
Copy link to clipboard
Copied
If you're using CFLOG to create your own log files, you can specify the exact name of those files, as described here:
https://www.raymondcamden.com/2010/11/29/Ask-a-Jedi-Prevent-ColdFusion-from-deleting-log-files
As for the "built-in" log files, there's no control over the log rolling process as far as I'm aware. So, you might want to use your own log files instead.
Dave Watts, Eidolon LLC
Copy link to clipboard
Copied
Thanks Dave. It is custom log file. As per link, it is suggesting to use cffile. We have this coded for 20 files and I want to avoid modifying this files.
Is there way, I can roll it by size?
Copy link to clipboard
Copied
I don't think you have any control over the built-in log rolling functionality.
Dave Watts, Eidolon LLC
Copy link to clipboard
Copied
Thanks..Will have to use cffile then.
Copy link to clipboard
Copied
Two things. First, you can indeed rotate the CF logs by size. That's the
default behavior. See the CF admin logging settings page for that, and to
change the size, if interested.
Second, as for log rotation by day, that's not a built-in feature. But there
is an AdminAPI method to rate the logs (just as most CF admin UI features
have an underyling admin API method). You could setup a scheduled task to
call that method nightly.
Here is a blog post that discusses that adminapi archiveLogFile ethod:
https://blog.trevorcotton.com/index.php/2017/07/27/rotating-your-coldfusion-
logs-daily/
Let us know if either of those suit your needs.
Copy link to clipboard
Copied
I didn't know about the admin API feature. Thanks!
Dave Watts, Eidolon LLC
Copy link to clipboard
Copied
One idea - Use cflog with custom file names based on the date, week or month you are trying to capture. So you end up with logs based some span of time.