A post was split to a new topic: Bad gateway when viewing app in ionic view
Yep! Just as we speak, the docs went live: http://ionicframework.com/docs/pro/monitoring/
New manual capture/log API: http://ionicframework.com/docs/pro/monitoring/#manual-capture
Would love your feedback on the update.
Thanks. Iāll take a look.
Hi! How can you show the error like before but only in devel environment (and trigger the exception log when running in prod)? I mean, something like:
if (prod) {
IonicPro.monitoring.handleNewError(err);
} else {
throw new Error(err);
}
Hmm not sure off hand, will think about this for the next sprintā¦
Hey all, lots of updates and improvements yesterday and today. Source mapping should be more accurate now and update more readily. Itās a Hard Problem to keep the two synced so a future update will automate source map generation to make it even easier.
One thing to make sure you do before continuing: update to @ionic/app-scripts
3.0.0
which fixed a production sourcemap bug we had (unrelated to Pro monitoring), and then follow the npm install steps in the docs to make sure youāre running at least @ionic/pro
1.0.9
I did it like this:
export class MyErrorHandler implements ErrorHandler {
protected _devMode: boolean = !window.hasOwnProperty('cordova');
handleError(err: any): void {
if (this._devMode) {
throw new Error(err);
} else {
IonicPro.monitoring.handleNewError(err);
}
}
}
But I think monitoring
should know itself whether to send exceptions or not (and display debug info in console).
Great suggestion. Iāll noodle on this and see if we can come up with something better. Weāre also working on environment variables in app-scripts in general so maybe we just always have a ENV setting for dev/prod.
I used to have a src/config/config.ts.sample
in my repo and in .gitignore
a line with src/config/config.ts
, so after cloning a project a developer just needed to copy config.ts.sample
=> config.ts
and thatās it, you could have env / prod vars depending on your needs (when building, we just replaced that file with prod values). In Pro (Iāve signed for the paid plan this week), since you have a new repo tu push and it builds from there (unlike before, where ionic upload
used to upload the entire builded env), I canāt use this approach anymore. This is because that runs in Ionic Pro and builds from new repo instead of uploading your project with all your files, and config.ts
wonāt exist and fail.
Iād like you to find a way to have different config files for different environments. Since you canāt do a āfile existsā with javacsript, itās also not possible/reliable to try to load a config file in not async mode (and itās not the purpose either in new standards) and overwrite variables.
Iād like to read suggestions on how to achieve this
Thanks!
Just started getting my feet wet with monitoring and love the potential. There are times when my error logs (via dashboard) toggle from source mapped: yes, to source mapped: no.
This could be inexperience on my part, or like you said, itās a work in progress.
Iāve logged errors from Ionic serve, Ionic View, and post phonegap build. Could the variation be the culprit?
Regardless, the documentation is starting to clarify and I like where itās headed.
Thanks!