@max this is still not working for me. I have started again with a brand new App ID and done the source map syncing.
In my app.component.ts I have the following four lines immediately at the beginning of the constructor:
Pro.getApp().monitoring.exception(new Error('error exception'));
Pro.getApp().monitoring.log('This is an error log', { level: 'error' });
Pro.getApp().monitoring.log('This is an info log', { level: 'info' });
Pro.getApp().monitoring.log('This is an info log with object', { level: 'info' }, { myObject: 'hello' });
After the I run the app (I am using Ionic Serve and when prompted for the Production Build by Ionic Pro I typed No) I get the following four entries on the view level of the Dashboard:
This is an info log with object
This is an info log
This is an error log
error Exception
Nowhere on that view does it distinguish between an info log entry and an error log entry (shouldn’t this be a view column?)
When I drill down in the four entries only the error Exception is correctly source mapped. I see this:
Exception Detail
Error: error exception
at new MyApp (app/app.component.ts:130:39)
private settingsService: SettingsService,
private actionSheetController: ActionSheetController
) {
Pro.getApp().monitoring.exception(new Error('error exception'));
Pro.getApp().monitoring.log('This is an error log', { level: 'error' });
Pro.getApp().monitoring.log('This is an info log', { level: 'info' });
Pro.getApp().monitoring.log('This is an info log with object', { level: 'info' }, { myObject: 'hello' });
None of the other three log entries show any source mapping and also the log message that I included data with does not show that data anywhere i.e I see this for that entry:
Message Detail
Original Stacktrace
This is an info log with object
at Monitoring.log (http://localhost:8100/build/vendor.js:68473:23188)
at new MyApp (http://localhost:8100/build/main.js:5791:77)
at createClass (http://localhost:8100/build/vendor.js:12526:20)
at createDirectiveInstance (http://localhost:8100/build/vendor.js:12363:37)
at createViewNodes (http://localhost:8100/build/vendor.js:13801:53)
at createRootView (http://localhost:8100/build/vendor.js:13691:5)
at callWithDebugContext (http://localhost:8100/build/vendor.js:15092:42)
at Object.debugCreateRootView [as createRootView] (http://localhost:8100/build/vendor.js:14393:12)
at ComponentFactory_.create (http://localhost:8100/build/vendor.js:11312:46)
at ComponentFactoryBoundToModule.create (http://localhost:8100/build/vendor.js:4272:29)
Should I not be able to see myObject:‘hello’ somewhere here?
Is there anything obvious I am doing wrong?
If you add these four lines to your Monitoring test app does it work for you?
Is there an example app you have published anywhere yet that shows Monitoring best practice etc? (could someone create a branch of the Conference app perhaps showing how you might use Monitoring?)
Here is my Ionic Info:
cli packages: (/Users/richardshergold/IonicProjects/app/myApp/node_modules)
@ionic/cli-utils : 1.17.0
ionic (Ionic CLI) : 3.17.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.5
Cordova Platforms : android 6.2.3 ios 4.5.0
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
Node : v6.11.4
npm : 2.15.12
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
thanks
Richard