HI All
I am creating a log file for our website which will log every log-in by all the users to our orders area. I wish to know if you think its good to enter this log info in just one single file or should this be split up once the log file hits a certain size? My concern is that this file will get rather large over time, but im not certain of the size limit of a text file?
thank you
There are limits, but that depends on:
Sometimes, you have facilities like
logrotatewhich can automatically handle chunking log files. Other times you do not.Would you want to parse and sort a 10GB log file? If the underlying OS has no facilities to chunk / archive the logs, you need to handle that in your own code.
Its as simple as naming your log file after the month-year, unless you are sure that something else will chunk your logs for you. To be portable, have your logging function check it out.
Note, even on systems that have facilities to rotate logs, often the log rotator has to be told that your logs exist. One huge file is, under any circumstances .. questionable.