For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Adjusting log verbosity
Seven log levels are available within the Logger API.
The logging levels from the most verbose to the least are as follows:
- TRACE - used for method entry and exit points
- DEBUG - used for method result output
- LOG - used for class instantiation
- INFO - used for reporting initialization
- WARN - used to log deprecated usage warnings
- ERROR - used for unexpected exceptions
- FATAL - used for unrecoverable crashes or hangs
The client SDKs are configured at the FATAL verbosity by default, which means little or no raw debug logs are output or captured. Adjust the verbosity programmatically. Log verbosity can also be adjusted by setting a configuration profile on the MobileFirst Operations Console, which must be retrieved explicitly by your app. Log levels set programatically are valid for the entire app. Levels set by the server are set per package. For more information, see Fetching server configuration profiles.
Once logging level is set, either by setting the client or retrieving the server profile, the client filters the logging messages it sends. If a message below the threshold is explicitly sent, the client ignores it.
To set the verbosity level to DEBUG:
- iOS
[OCLogger setLevel:OCLogger_DEBUG];
Android Logger.setLevel(Logger.LEVEL.DEBUG);
JavaScript (Cordova) WL.Logger.config({ level: 'DEBUG' });
web For the web SDK the default trace level cannot be changed from the client.
Parent topic: Logger SDK