Comments (9)
If you don't catch http request fails they will be handled by loggly. In my case to prevent endless offline logs i have to add .catch(console.error) to $http.post that logger method uses to send logs.
//current version
//Ajax call to send data to logglyÎ
$http.post(buildUrl(), sentData, config);
//my fix
//Ajax call to send data to logglyÎ
$http.post(buildUrl(), sentData, config).catch(console.error);
`
from angular-loggly-logger.
@Cleod9 thanks for kicking this back to my inbox. I just merged the PR for this in and will cut a new release here shortly.
from angular-loggly-logger.
Any news on this? Am using this nice wrapper in a Ionic/cordova app, my only problem is when the app is offline and a error occurs it will try to log to loggly and this fires another error which sends the app into a infinite loop and it eventually crashes. Is there anyway to disable and enable the logglyLogger at runtime? that way I would be able to disable it when "offline" event fires and enable when "online" event fires.
from angular-loggly-logger.
@icedice Thanks for the info, I didn't realize how bad this really was. I was holding off on this feature for the next major release, but from the sound of it it's much more urgent. I'll throw something together here in the next couple of days.
from angular-loggly-logger.
You don't need to hurry. I did a quick customisation of your (great) wrapper så it only tries to contact loggly if it is online. This means that I loose messages when the app is offline but this is not critical for me also it could be solved with some kind of cache which then sends it when it's back online. Anyways I still thing this would be a great feature en a future release.
from angular-loggly-logger.
Would you mind opening a pull request for it? I'd love to see what you've
done.
On Fri, Sep 9, 2016 at 11:22 AM, Toke Refstrup [email protected]
wrote:
You don't need to hurry. I did a quick customisation of your (great)
wrapper så it only tries to contact loggly if it is online. This means that
I loose messages when the app is offline but this is not critical for me
also it could be solved with some kind of cache which then sends it when
it's back online. Anyways I still thing this would be a great feature en a
future release.—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#36 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AACWMvUHERfFsKVdmpY3LiqqIbYKJ4xdks5qoXmbgaJpZM4GvR72
.
A.J. Brown
@AdrianJBrown http://twitter.com/adrianjbrown on Twitter
http://ajbrown.org on The Web
from angular-loggly-logger.
Sure, but it's just a really quick fix, basically I just surrounded the ajax call to loggly so it only gets called if we have net. I'm using Cordova network plugin if available otherwise I use navigator.onLine....
from angular-loggly-logger.
I assume this project has likely kicked the bucket, but I wanted to point out how serious of an issue this is. I've confirmed that users who use uBlock Origin are likely heavily affected by this issue, because loggly is blocked before the request goes out. This mimics an "offline" effect, throwing the app into an infinite memory-consuming loop.
See uBlock's logs below:
See Firefox's Memory Usage as well:
(Same issue in Chrome though at least Chrome will abort the tab after a certain point)
If I didn't know any better I would have thought something malicious was going on 😬
from angular-loggly-logger.
This has been fixed and released in 0.3.2
from angular-loggly-logger.
Related Issues (20)
- Npm install fails unless bower is already installed HOT 1
- RequireJS Only? HOT 1
- Error when using $httpProvider.defaults.withCredentials = true HOT 6
- CORS issue with 0.2 HOT 3
- Update bower.json to latest version of angular.
- Support customizing `timestamp`, `level` labels. HOT 2
- sendMessage doc is not right (i think)
- Add `logUserAgent()`? HOT 1
- stack isn't sent for errors caught by window.onerror HOT 2
- Fake logging events? HOT 1
- `angular-mocks` and `angular-loader` should be `devDependencies` HOT 3
- Batch log requests HOT 1
- Option to avoid logs flood HOT 2
- Module could not get injected after Uglifying
- CORS issue exists with 2.4 HOT 7
- Send uncaught injector errors of angular
- Release latest on npm HOT 2
- CORS even using deleteHeaders function
- DepShield Deprecation Notice
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-loggly-logger.