Auth0 Logs to Logentries
The Auth0 Logs to Logentries is a scheduled job that takes all of your Auth0 logs and exports them to Logentries.
Configuring the Extension
To install and configure this extension, click on the Auth0 Logs to Logentries box in the list of provided extensions on the Extensions page of the Management Portal. The Install Extension window pops open.
At this point you should set the following configuration variables:
- Schedule: The frequency with which logs should be exported. The schedule can be customized even further after creation.
- BATCH_SIZE: The amount of logs to be read on each execution. Maximun is 100.
- LOGENTRIES_TOKEN: The Logentries Token for your log set to which the Auth0 logs will be exported.
- LOG_LEVEL: The minimal log level of events that you would like sent to Logentries.
- LOG_TYPES: The events for which logs should be exported. If you want you can send only events with a specific type (for example, failed logins).
Once you have provided this information, click the Install button to finish installing the extension.
When setting your BATCH_SIZE, please keep the following information in mind.
During each time frame/window (defined by your chosen Schedule), outstanding logs will be batched into groups and sent. The size of each group is determined by the BATCH_SIZE value.
In other words, during each window,
NUM_BATCHES batches of logs will be sent based on the following logic:
IF (NUM_LOGS modulo 100 == 0): NUM_BATCHES = (NUM_LOGS / BATCH_SIZE) ELSE: NUM_BATCHES = (NUM_LOGS / BATCH_SIZE) + 1
ELSE case, the last batch will have < 100 logs.
Retrieve the required information from Logentries
In order to acquire the LOGENTRIES_TOKEN information, navigate to Logentries and login to your account or register for a new one. From the menu on the left select Logs > Add New Log.
Click on the Manual button.
Set a Log Name and either create a new Set or pick an existing. For the purposes of this tutorial we will pick the existing DemoSet.
You are now ready to create your new log. Click on the Create Log Token button at the bottom of the page. Once you do the button will be replaced with a text box displaying your new token, registered for this log. Copy this information and click on Finish & View Log.
You can now go back to your Auth0 Dashboard and populate the LOGENTRIES_TOKEN field of the extension with the value you copied.
Using Your Installed Extension
To view all scheduled jobs, navigate to the Extensions page of the Management Portal, click on the Installed Extensions link, and select the Auth0 Logs to Logentries line. There you can see the job you just created, modify its state by toggling the State switch, see when the next run is due and what was the result of the last execution.
You can view more details by clicking on the job you created. In this page you can view details for each execution, reschedule, access realtime logs, and more.