As of now I use NSLog for logging from my OS X application. But NSLog gives me no control over log level, size and number of log files. Other problem I face with NSLog is even though I redirect log statements to a file, I still see entries in System log (using console).
I found a logging framework log4cocoa, but this looks very old. Before making decision and start using log4cocoa, I want to know which all free logging frameworks are available for cocoa and merits / demerits of those.
Update: I also found one more logging framework called lumberjack. I am gonna try these two and see how they fair
OS X includes a built-in logging facility, the Apple System Logger (ASL). ASL supports multiple output streams, and logging levels.
Peter Hosey's series on the ASL is still the best introduction to the system and its API. The ASL API is in C, but it's quite easy to write an Objective-C wrapper and some preprocessor macros to make your life easier. The Google Toolbox for Mac has the GTMLogger
class that supports flat-file, stdout, and ASL (via the GTMLogger+ASL category). If you don't mind taking an additional dependency, I would use GTM and its GTMLogger
facilities.
Check Best Logger for cocoa answers too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With