Skip to content

Latest commit

 

History

History
38 lines (23 loc) · 1.14 KB

README.md

File metadata and controls

38 lines (23 loc) · 1.14 KB

Logtail JavaScript

Collect logs from both the Node.js backend and your frontend.

Example project

To help you get started with logging using Logtail, we have created an example project.

Make sure you have npm installed and also make sure you have Node.js installed and up-to-date.

Install the example project

Clone the git repository or download it as a ZIP and extract it into a select directory which will be your projects directory.

Then run the following command to install all dependencies (@logtail/js):

npm install

Run the example project

To run the example project, simply run the following command and don't forget to replace the <source-token> with your actual source toke, which you can find in source settings.

node index.js <source-token>

You should see the following output:

Output:
All done! You can check your logs now.

This will generate a total of 4 logs, which can be displayed in your Logtail live monitor.

To learn more about using Logtail in your JavaScript projects, visit official documentation.