O'Reilly logo

AngularJS Services by Jim Lavin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Logging application analytics and errors

We covered how to alert the user when things happen. Now, let's look at how you can build a logging service that you can use to alert you when things happen in your application.

Logging and tracing is another layer that cuts across all of the other layers in your application. The logging service we are going to cover uses a common JavaScript library called log4javascript. This library is very versatile and allows you to log either locally or remotely using the various appenders and layout formatters in the library. The following sample uses the basic BrowserConsoleAppender, which sends all output to the console window in your browser:

angular.module('brew-everywhere').factory('logging', function (messaging, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required