Documentation forLoggly

AngularJS Logging

You can send your AngularJS logs to Loggly via HTTP/S. For AngularJS 1.X, we have used the angular-loggly-logger library to send AngularJS logs to Loggly. You can also send Javascript objects or JSON data and we will automatically parse it for each searching. For Angular 2+, please see our post Angular Exception Logging Made Simple. You can see more alternatives in the Advance Options section below.

AngularJS Logging Setup

1. Install Angular Loggly Logger

Install the angular-loggly-library using in your current project using Bower.

bower install angular-loggly-logger --save

This will install the loggly logger module and its dependencies to your bower_components folder.

2. Configuring the Loggly Module

To send logs to Loggly, you need to configure the logglyLogger module by adding your customer token. As an example, you can create the file ExampleApp.js and put the following code inside it.

angular.module( 'ExampleApp', ['logglyLogger'] )
.config( function( LogglyLoggerProvider ) {
  LogglyLoggerProvider.inputToken( 'TOKEN' ).sendConsoleErrors(true);


3. Send Test Logs

You can send test logs by using the regular angular log handler $log. For example, you can create a controller to send a test log to Loggly by pasting this in the bottom of ExampleApp.js.

angular.module( 'ExampleApp') .run( function( $log ) { $ 'Test Logs to Loggly' ); });

Create a web page and provide the ng-app directive to the html tag.

<html ng-app="ExampleApp" > 

Open the page in your browser to run the code.

4. Verify Events

Search Loggly for events with the tag as angular over the past 20 minutes. It may take few minutes to index the event. If it doesn’t work, see the troubleshooting section below.


Advanced AngularJS Logging Options

AngularJS Log Troubleshooting

If you don’t see any data show up in the verification step, then check for these common problems.

  • Wait a few minutes in case indexing needs to catch up
  • Make sure you configured your customer token
  • Open your developer tools for the browser, then the network tab, to make sure that the script is loaded, and that events are being sent to
  • Search or post your own AngularJS error logging questions or others, such as logging client-side errors or enhancing AngularJS in the community forum.

When the APM Integrated Experience is enabled, Loggly shares a common navigation and enhanced feature set with the other integrated experiences' products. How you navigate the product and access its features may vary from these instructions. For more information, go to the APM Integrated Experience documentation.

The scripts are not supported under any SolarWinds support program or service. The scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.