What would be the best way to write log statements to a file or database in an iPhone application?
Ideally, NSLog() output could be redirected to a file using freop
Consider using Cocoa Lumberjack. It's a light but flexible utility to replace NSLog functionality. In my opinion it's in the same class as Log4J, allowing for custom appenders and the like. It has an SQLite logger, for example.