/le_js

Client-side JavaScript logging library for Logentries

Primary LanguageJavaScriptOtherNOASSERTION

le.js

Client-side JavaScript library for Logentries.

Build Status

Want to get under the hood? Check out the wiki

Features

  • Small: ~2k (minified)
  • Cross-browser compatible
  • No external dependencies
  • Simple API

Usage

  • Get the latest build here or download a source release.

  • Include the library in your page:

<html lang="en">
  <head>
    <title>your page</title>
    <script src="/js/le.min.js"></script>
    <script>
      // Create a log stream...
      LE.init('YOUR-TOKEN');
      // ...and log some events!
      LE.log("Hello, logger!");
    </script>
  </head>
  ...

Want to send all browser exceptions to Logentries? Initialize the logger with an object:

LE.init({token: 'YOUR-TOKEN', onerror: true});

sets a window.onerror callback for the given stream, invoking the current handler too if it exists.

Need a token? Get a free account if you don't already have one.