loggly/loggly-jslogger

Stack trace features?

dandv opened this issue · 18 comments

dandv commented

Any plans for this? Nothing fancy like TrackJS's telemetry, but at least backtraces like the ones provided by Rollbar, Airbrake, or GetSentry.

sendConsoleErrors value to true will send all the unhandled errors to the Loggly. Does this match what you're looking for?

@dandv Try setting

_LTracker.push({
                'logglyKey' : 'your-key',
                'sendConsoleErrors' : true
            });

You should be able to send stacktraces to Loggly.

dandv commented

Here's what I mean by a stack trace:

image

Judging by its description, sendConsoleErrors only seems to log unhandled errors, but there is no mention of stack traces on the client at https://www.loggly.com/docs/javascript/.

@dandv are you talking about catched errors? or stack traces of unhandled errors?

dandv commented

I'm looking for a client-side JS error logger for both caught and uncaught errors. Rollbar and {Track:js} seem to do the best job at the so far. See rollbar/rollbar.js#108.

yeah the current functionality leaves allot to be desired

I have a question. I have a minified js file and it's impossible to get a real error, for this problem I need to generate a source map file for each javascript file. How Loggy deals with it? @varshneyjayant

Sorry, I think that I didn't explain myself correctly. I have an app built using requirejs and I am generating the source map files for each one. My problem is that when I send to loggly the error exception I can't see the not-compiled version in the dashboard. Is it possible to see the non-compiled version instead of the compiled version in Loggly? Maybe there is a way to say Loggly to use the source map files before send the log exception. In that way I could see the error line and row easily and don't try to guess where the error happened. Thanks @varshneyjayant

We were experiencing the same issue as described by @marcelodeveloper .
We're using something similar to what is PRed above if you're interested @varshneyjayant

For reference, this article on Sentry's blog thoroughly covers the implementation details to get a cross-browser stack trace. It's not trivial - you need to to invasively augment methods like setTimeout and addEventListener. https://blog.sentry.io/2016/01/04/client-javascript-reporting-window-onerror.html

Thanks for the link! We will review this next time we do an update of the JavaScript library, but there are a few other projects ahead of this one in the queue.

Any update?

Thank you for reporting this issue. We are now tracking this issue internally as LOG-12076.

I have tried multiple browsers and using SolarWinds example simply does not produce any logs on Loggly.

I can see the HTTP request in my browser tools (on Safari, Chrome, and Firefox) all make a successful request and get a 200 response. I have tried both with and without the async attribute.

What is wrong with the following page:

<title>Testapp</title> <script type="text/javascript" src="">cloudfront.loggly.com/.../script> <script> var _LTracker = _LTracker || []; _LTracker.push({ 'logglyKey': 'I REMOVED MY KEY', 'sendConsoleErrors': false, 'tag': 'javascript-logs' }); </script> Hello this is a test.

@markreha the setup looks fine, but I do not see any commands to actually send something - what you've got there is just the setup. You can send a log to Loggly by something like _LTracker.push("my Loggly message").

If there still won't be any logs coming (usually takes a few seconds), double-check the key and make sure you're not using any filters in Loggly UI.

If you believe there is an issue with Loggly, the best way is to reach out to our support directly, or if you want to use Github, please open a separate issue so we can track it better.

Sorry, I used the API Key and not the APP Key.....