firstname.lastname@example.org Posted January 19, 2021 Report Share Posted January 19, 2021 I have an error log and a couple other logs associated with a program I've written. My question is this, when you read a log file, do you expect the newest information at the beginning of the file or the end. I think I prefer it at the beginning of the file... That said I worry about large log files. The only way I figured out how to accomplish this was to read the entire file, add my new entry at the beginning and then re-write the entire file. Seems like a lot of overhead just for a style preference. Is there a better way to accomplish writing new entries at the beginning? Or does everyone prefer new log entries at the end of the file? thanks for you comments and ideas... Bob Harmon Quote Link to comment
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.