Web Design Forums

PHP

Have questions about PHP? Ask them here and our experts will assist you before you know it! You can also find help in the documentation at PHP.net.

Error Logging - txt files or DB



Site of the Month Voting - Now Open. CAST YOUR VOTE NOW!

Reply
 
LinkBack Thread Tools
Old March 11 '10, 09:55 AM (#1)
medlington is offline
WDF Regular
 
medlington's Avatar
 
Join Date: November 2005
Location: Sheffield, UK
Posts: 185
medlington is on a distinguished road
Error Logging - txt files or DB

Hi,

Im setting up some error logging to record PayPal transaction details and Im just wondering if it would be better to store the log in a database or a txt file? I think a txt file would be slighty quicker as it wouldnt have to connect to the database, is this correct?

whats good practice if I store it in a txt file? should I store it in one big txt file or should I have the script create new txt files everytime the log file reachs a certain size say 100K? Should I only keep a log for a few months or do you normally keep a log for the entire life of a site?

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 11 '10, 10:32 AM (#2)
mlseim is offline
WDF Staff
 
mlseim's Avatar
 
Join Date: April 2004
Location: Cottage Grove, Minnesota
Posts: 3,359
mlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud of
I would use a .txt file and give the filename something like: paypal_error_log_2010_03.txt

You check to see if the file is already made for the year and month, if not, create it,
if it exists, append to it.

Filename is descriptive, so you know by viewing directory what the file contains.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 11 '10, 01:53 PM (#3)
medlington is offline
WDF Regular
 
medlington's Avatar
 
Join Date: November 2005
Location: Sheffield, UK
Posts: 185
medlington is on a distinguished road
Thanks, that seems a sensible way to do it and seems to work nicely
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Web Design Forums » Programming Help » PHP

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Files in FTP transfer not arriving locally even though status says "transfer complete darkbreed General Web Design Discussion 2 December 24 '09 12:31 AM
Find and replace files rather than txt medlington General Web Design Discussion 3 November 18 '09 08:26 AM
colorhost slyder Server Administration Help 3 July 20 '07 05:25 PM
how to open ASPX files Aneeliyo Other Languages 4 October 3 '06 03:08 AM
WAV, MIDI, Flash - Finding the best sound file format abacomedia The Rest 0 May 20 '04 03:29 PM

 
User Infomation
Your Avatar

Site Of The Month
Nominate Your Site Now!

Advertisement
WolfCMS.org

Latest Articles
- by RickM
- by bfsog

Advertisement

Partner Links



All times are GMT -4. The time now is 01:54 PM.


WebDesignForums.net is Copyright © 2010 RikeMedia.

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164