By

Tracking of console logs in production

Most of the developers use print statements to debug their apps whether it is web or command line tool. In web apps, we used to see lot of console logs in the code. This can be very useful when you want to figure out the root cause of the errors in production or development.

In Atatus, we introduced console log monitoring in production. By default Atatus will watch all console activity and include that information in the Timeline. A Timline is all the user actions, such as the number of characters the user gave as input, the click events and the rest of the user actions that lead to the error. Also any calls to console.error() will automatically trigger an error.

You can disable and enable these options as follows

atatus.config('YOUR_API_KEY', {

   // Enable or Disable all console activity
   console: true,

   // By default Atatus will watch all console activity and include that information in the Timeline
   consoleTimeline: true,

   // Set this to false if you don't want your users seeing anything when the dev tools open.
   consoleDisplay: true

   // Set this to false if you don't want console.error() to trigger errors.
   consoleErrorNotify: true,

   // Specify levels only if you want to watch certain console functions
   consoleTimelineLevels: ["log","debug","info","warn","error"]

 }).install();

You can use your console just like a normal server side logging platform. During production, if you’re worried that your users might see things, you can turn off console visibility in production with the following configuration:

atatus.config('YOUR_API_KEY', {

   consoleDisplay: false // Hides console logs from the users/dev tools, but keeps them in your timeline

 }).install();

You’ll still get great context from your console logs, but your users won’t be concerned by it!

Blackboxing

You may also notice that console messages and stacktraces contain references to atatus.js. This is a side-effect of our wrapping. If you’re developing in Chrome, you can exclude our script by Blackboxing it.

Blackboxing atatus script

If you have any questions, we’d love to hear from you.

Written by
Developer

With Atatus, Get to know exactly how your users are experiencing your app.

Start your free 14-day trial