Types of Logging for VMware Workspace ONE SDK enabled iOS Apps


The Logging module of the Workspace ONE SDK allows developers to instrument their applications to discover bugs or any issues when the application is deployed to users.

The Workspace ONE SDK Logging provides the following types of logs:



Crash Logs

This type of log captures data from an application the next time the application runs after it crashes. These logs are automatically collected and uploaded to the Workspace ONE Admin Console without the need for extra code in the SDK application.

Application Logs

This type of log captures information about an application. You set the log level in the default SDK profiles section, Groups & Settings > All Settings > Apps > Settings and Policies > Settings > Logging. To utilize this, you must integrate SDK with your internal application or using existing Workspace ONE apps that have the SDK integrated already, such as Workspace ONE Web

Device Logs

This type of log captures information on devices using NSLog statements from all the applications running on the device. They provide some context of what else is happening on the device when an issue arises. You must add code into the application to upload them to the Workspace ONE Admin Console.

Note: Please be careful on the logging level selected for Application logs to ensures that your network is not burdened with unwanted logging activity.



Example Implementation for Application Logs

You must set the outputDestinationMask on AWLog's sharedInstance before any use of logging can take place. Use the following string to enable logging:

self.outputDestinationMask = AWLogOutputDestinationDeviceConsole|AWLogOutputDestinationLogFile;
Note: This code can go into your application's AppDelegate file.


There are four macros that follow the same format as the standard NSLog(...) macro in iOS. Each macro will record an event for the four different logging levels (Different level specifications are listed in the last part of the article):

  • Verbose - AWLogVerbose
  • Info - AWLogInfo
  • Warning - AWLogWarning
  • Error - AWLogError

To implement an example that showcases the logging levels, set up a UI page similar to the following:



Next, implement a method called sendApplicationLogButtonPressed to handle the "Send Application Log" button. Similarly, sendDeviceLogButtonPressed will handle the "Send Device Log" button. The following mappings show which methods are called from which buttons (w/format method() : button title):

  • logVerbose() : Verbose
  • logInfo() : Info
  • logWarning() : Warning
  • logError() : Error
  • checkRequestLogCmd() : Check for Request Log Command

An example is as follows:

- (IBAction)sendApplicationLogButtonPressed:(id)sender
AWLogVerbose(@"Send the application logs.");

[[AWLog sharedInstance] sendApplicationLogsWithCompletion:^(BOOL success, NSError *error) {
AWLogInfo(@"Send application logs %@!", success ? @"succeeded" : @"failed");

AWLogVerbose(@"Send the device logs.");

[[AWLog sharedInstance] sendDeviceLogsWithCompletion:^(BOOL success, NSError *error) {
AWLogInfo(@"Send device logs %@!", success ? @"succeeded" : @"failed");


You also have the ability to add a label above that denotes the Logging Level. The following code can be used to implement this method:

/* The following code is not necessary to use logging. It's simply used to display the value set in the console */
NSArray *profiles = [self.profileStore allSDKProfiles];
if (profiles && [profiles count])
AWProfile *profile = [profiles objectAtIndex:0];
AWLoggingPayload *pay = [profile loggingPayload];
if (pay)
if (AWLogLevelOff == [pay loggingLevel])
self.loggingLevelLabel.text = @"Off";
else if (AWLogLevelError == [pay loggingLevel])
self.loggingLevelLabel.text = @"Error";
else if (AWLogLevelWarning == [pay loggingLevel])
self.loggingLevelLabel.text = @"Warning";
else if (AWLogLevelInfo == [pay loggingLevel])
self.loggingLevelLabel.text = @"Info";
self.loggingLevelLabel.text = @"Verbose";
} else
self.loggingLevelLabel.text = @"Off";
} else
self.loggingLevelLabel.text = @"Off";


Example Implementation for Crash Log Reporting

For application crash logs, the AwCrashLogReporter API is used. See the code below for an example.
Note: The debugger catches the signal before AwCrashTracker is able to. Due to this, the tracker cannot write the crash log to the disk. A workaround is to stop the debugger, run the app from the device, crash the app, and then run the debugger again. You will now be able to step through the crash reporting code. An example is as follows:

AWCrashLogReporter *crashLogReporter -[[AWCrashLogReporter alloc]init];
// Report previous crash log to console
if ([crashLogReporter hasPendingCrashReport]) {
NSLog(@"Application crashed previously !!");
NSLog(@Reporting crash to console started ...");
[crashLogReporter reportCrashLogToConsole];
NSLog(@"Application crashed previously !!"); NSError *error = nil;
// Instantiate the crash log reporter for this session.
if (![crashLogReporter startUp:&error])
NSLog(@"Crash tracking instantiation failed !!");
NSLog(@"Error starting up crash log reporter : %@",


Last Steps

You now have the ability to customize the logging ability of your application in order to get a better view of what is going on while it runs. Make sure to choose your logging level appropriately in the SDK profile from the spectrum or recording options that follow:




Records only errors. An error displays failures in processes such as a failure to look up UIDs or an unsupported URL.


Records errors and warnings. A warning displays a possible issue with processes such as bad response codes and invalid token authentications.


Records a significant amount of data for informational purposes. An information logging level displays general processes as well as warning and error messages.


Records all data to help with troubleshooting. This option is not available for all functions.

Note: The Workspace ONE UEM Console reports the messages that match the configured logging level plus any logs with a higher critical status. For example, if you set the logging level to Warning, messages with a Warning and Error level display in the Workspace ONE Admin Console

Have more questions? Submit a request


Article is closed for comments.