Reading Large Log Files with CFFile

Posted on 2009-05-22
Medium Priority
Last Modified: 2013-12-24
I am reading my iis log files into my database with CFFile so I can create custom stat reports for my clients. Problem is the files are now getting to be above 160Mb and sometimes CFfile does not do anything. I guess it tries to read the file, but fails. I am on a shared server. See code below what I am using.

Is there anyway to read the log files that won't cause it to fail?
<cfset timeoutVar = "500"><cfsetting RequestTimeout = "#timeoutVar#">
<cfset mydate = "#dateformat(application.mydate,'yymmdd')#">
<!------------ By default set value ------------>
<cfparam name="file2load" default="D:\inetpub\mydomain\stats\ex#mydate#.log">
<!------------ Load the file ---------------->
<cffile action="READ" file="#file2load#" variable="log_data">
Log file Read<hr>

Open in new window

Question by:monosyth
LVL 19

Expert Comment

ID: 24454067
Reading 100mb into memory is a bad idea.

If you are on CF8 try rear say 1k lines at a time with fileReadLine()


Accepted Solution

mik77 earned 2000 total points
ID: 26320914

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Media Temple is thrilled to announce the launch of our new Partner Program, specifically designed to empower digital agencies and adtech platforms by offering white-glove support and exclusive hosting enhancements to optimize their sites and their c…
If you are looking for an automated solution for backup single or multiple Office 365 user mailboxes to Outlook data file, then you can use Kernel Office 365 Backup & Restore tool. Go through the video to check out the steps to backup single or mult…
In the video, one can understand the process of resizing images in single or bulk. Kernel Bulk Image Resizer is an easy to use tool for resizing large number of images. One can add and resize multiple images with this tool in single go. The video sh…
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question