XCDLumberjackNSLogger 1.1.1

XCDLumberjackNSLogger 1.1.1

LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Oct 2016

Maintained by Cédric Luthi.

Depends on:
CocoaLumberjack>= 2.0
NSLogger>= 1.7


XCDLumberjackNSLogger is a CocoaLumberjack logger which sends logs to NSLogger.


  • Runs on iOS 8.0 and later
  • Runs on OS X 10.10 and later
  • Runs on tvOS 9.0 and later


XCDLumberjackNSLogger is available through CocoaPods and Carthage.


pod "XCDLumberjackNSLogger", "~> 1.1"


github "0xced/XCDLumberjackNSLogger" ~> 1.1


XCDLumberjackNSLogger is fully documented.

Binding to User Defaults

The easiest way to use XCDLumberjackNSLogger is to bind a logger to a user defaults key.

[XCDLumberjackNSLogger bindToBonjourServiceNameUserDefaultsKey:@"NSLoggerBonjourServiceName" configurationHandler:nil];

Anytime you change the user defaults key (NSLoggerBonjourServiceName in this example), the logger reconnects to the desktop viewer with the given service name.

You can change the service name user defaults manually with

[[NSUserDefaults standardUserDefaults] setObject:serviceName forKey:@"NSLoggerBonjourServiceName"];

or with a Settings bundle:

    <string>NSLogger Service Name</string>

This is very handy to get logs even in the App Store with zero overhead. Just open the settings of your app (in the iOS Settings app) and change the service name to automatically activate the logger.

When debugging with Xcode you can set -NSLoggerBonjourServiceName "Your Service Name" in Arguments Passed On Launch in your scheme to set the NSLoggerBonjourServiceName user default.

Simply send logs to NSLogger

[DDLog addLogger:[XCDLumberjackNSLogger new]];

Configuring a bonjour service name

NSString *bonjourServiceName = [[[NSProcessInfo processInfo] environment] objectForKey:@"NSLOGGER_BONJOUR_SERVICE_NAME"];
[DDLog addLogger:[[XCDLumberjackNSLogger alloc] initWithBonjourServiceName:bonjourServiceName]];

Translating contexts to tags

XCDLumberjackNSLogger *logger = [XCDLumberjackNSLogger new];
logger.tags = @{ @80 : @"CocoaHTTPServer", @((NSInteger)0xced70676) : @"XCDYouTubeKit" };
[DDLog addLogger:logger];

Configuring a viewer host

XCDLumberjackNSLogger *logger = [XCDLumberjackNSLogger new];
LoggerSetViewerHost(logger.logger, CFSTR(""), 50000);
[DDLog addLogger:logger];


Cédric Luthi


XCDLumberjackNSLogger is available under the MIT license. See the LICENSE file for more information.