Getting a Debug Log
Common issues with using multiple push providers under one mobile app
When something isn't working as expected, the best way to see what’s occurring under the hood without sharing the source code, is to capture a debug log. With this log, you can further analyze your app or share it with our Support Team for further assistance.
You're Viewing User Model Documentation 🎉
OneSignal is in the process of migrating from a device-centric model (player ID) to a new user-centric data model (OneSignal ID). To learn more, check out the User Model Migration Guide.
Please refer to Version 9 of our documentation for device-centric information.
Requirements
- A device able to reproduce the issue
- Access to the mobile app's dev tools
- OneSignal Mobile SDK 5.0.0+ (If using an earlier SDK version see Version 9.0 docs)
Get the Logs
1. Add Verbose Logging To Your App
OneSignal.setLogLevel
allows you to get extra logging related to OneSignal's API requests. Call this method with the verbose
option before OneSignal.init
.
Set the logging level to print logs Android LogCat or Xcode logs.
// LogLevel: NONE | FATAL | ERROR | WARN | INFO | DEBUG | VERBOSE
OneSignal.getDebug().setLogLevel(OneSignal.LOG_LEVEL.VERBOSE);
// LogLevel: .None | .Fatal | .Error | .Warn | .Info | .Debug | .Verbose
OneSignal.Debug.logLevel = LogLevel.Verbose
// LogLevel: ONE_S_LL_NONE | ONE_S_LL_FATAL | ONE_S_LL_ERROR | ONE_S_LL_WARN | ONE_S_LL_INFO | ONE_S_LL_DEBUG | ONE_S_LL_VERBOSE
[OneSignal.Debug setLogLevel:ONE_S_LL_VERBOSE];
// LogLevel: ONE_S_LL_NONE | ONE_S_LL_FATAL | ONE_S_LL_ERROR | ONE_S_LL_WARN | ONE_S_LL_INFO | ONE_S_LL_DEBUG | ONE_S_LL_VERBOSE
OneSignal.Debug.setLogLevel(.LL_VERBOSE)
// LogLevel: None | Fatal | Error | Warn | Info | Debug | Verbose
OneSignal.Debug.LogLevel = LogLevel.Verbose;
OneSignal.Debug.setLogLevel(6);
OneSignal.Debug.setLogLevel(OSLogLevel.verbose);
// 0 = None, 1 = Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
window.plugins.OneSignal.Debug.setLogLevel(6);
2. Reproduce the Issue
Plug the device into your dev tools and reproduce the issue while capturing the log. This will help trace any events and will likely help uncover any errors that might be happening.
Share
If the log didn't help solve the issue and you need further assistance, please share the entire log from app start to end of reproduction as a .txt file.
Android Studio
- Select Run from the bottom of the window.
------If you don't see this select it from View > Tool Windows > Run
- Run your application on your emulator or device
- Select all lines in the log that appear within your Run console by pressing Control + A and then copy them.
- Paste them into a .txt file and send this to support.
Here's a sample log for reference:
https://drive.google.com/file/d/1XphR4u4CRtUO37X6VZzzeyLUhq5pRMYw/view?usp=sharing
Xcode
NOTE: For your crash to show in the following steps the crash must happen when your device is not connected to your Mac. Connect it after you reproduce the crash.
- In Xcode go to
Window
>Devices & Simulators
. - Select your device on the left and press the "Open Console" button.
- Select "All Messages" (top left)
- Reproduce issue with the connected device.
- Press
Command + A
to select all, thenCommand + C
to copy log - Send it to OneSignal support along with details on reproducing the crash.
Updated about 1 month ago