[eluser]WanWizard[/eluser]
In general, a database is a lot more efficient in I/O that you are. If you want to store it in a text file, you need logic to read, add, and write, and to deal with concurrency (you need a locking mechanism to prevent corruption in case of simultaneous requests).
Ideally, you wouldn't do this in your application, but use an external tool (p.e. based on webserver logs, Google analytics, etc) to compile reports of visitors.