Log in to Logentries and create a new log by clicking the Add New Log button. Now click Manual Configuration button from the list of options. Give your log a name of your choice, select Token TCP and finally click the Register new log button. A token will be displayed in green. Please record it as we will use it later to configure the library.
Get the latest build here from our Github repository. We recommend using le.min.js in a Production environment
Include the library in your page:
<html lang="en"> <head> <title>Your page</title> <script src="/js/le.min.js"></script> <script> // Set up le.js LE.init('YOUR-LOG-TOKEN'); </script> </head>
Replace LOGENTRIES_TOKEN with the token we copied earlier. It connects this logger with that file on Logentries. If you haven’t taken note of the token when creating your log, you can retrieve it by logging in to Logentries. Once logged in, select the host containing the log for which you want to retrieve the token (e.g. from the side bar on the left hand side of the page). All the token-based logs of this host are then displayed with a Token icon on the right hand side. Click this icon to display the token. Place the following in your code to start logging straight away:
<script> // log something LE.log("Hello, logger!"); </script>