Audit Logs

Overview

Product companies need to know how customers use their product. This is critical for building features that fit your customer's needs in addition to analyzing diagnostic performance and correcting errors.

As a SaaS company, knowing how customers use your product means logging what they are doing in your software.

Building logging capabilities, however, is a hassle. The sheer size and complexity of actions to track, plus the precision you need to keep everything organized, accurate and updated, make it a challenging feature to build and maintain. If compromised or incorrectly configured, audit logs are useless.

Frontegg solves this problem for you. Audit logging is one of the enterprise features in our core set of user-management tools. Just by implementing Frontegg into your application, you can have peace of mind and stay focused on your core business knowing that your application is reliably logging customer actions.

Get started now with Frontegg audit logs:

Watch Video To Learn More

Our fully-scalable multi-tenant audit log solution gets you closer to full-product maturity in no time at all. It is customizable, secure, and provides comprehensive visibility into how your customers use your application.

Watch this video to see Frontegg audit logs in action.


Automatic Logging

Frontegg comes with automatic audit logging from the moment you integrate it into your application. We automatically log events that happen when your customers use our product. For instance, we automatically log user-management events like when a user logs in, modifies their settings, and other related events. Plus, we log actions like if a lag is detected, if a security audit is performed and other performance and maintenance events related to Frontegg's tools.

Aside from integrating Frontegg, you do not need to do anything to start the automatic logging process.

πŸ“˜

See the logs in your admin portal

Go to the admin portal in your application and in the sidebar you should see Audit Logs. If you do not see Audit Logs in your admin portal, read below to learn how to add it to your side bar.



Custom Logging

Customize what you log by adding your own events in addition to the automatic logging. For instance, you can log events that are specific to your application, like if a user uploads a photo, upgrades a subscription, or pretty much anything.

You just need to add some code to your application. Read below to get the code and learn how to add it.

Export Log Data

You can export the log data to use however you want. Before downloading the data, choose your data structure.

When choosing your own data structure, you can turn on or off default fields in addition to adding new data fields. This gives you the freedom to make your own audit reports using the data that you are interested in.


However you structure your you downloading is also how you will see it in the admin portal.



πŸ“˜

To add new log fields and customize data downloads, in your Frontegg Dashboard go to Self-Service β†’ Capabilities β†’ Audit Logs.


Read below to learn more about integrating and customizing your audit logs.

Working With Audit Logs

Frontegg events are automatically being logged from the moment you integrate Frontegg into your application. However, to get more out of your audit logs, consider:

Add Audit Logs to Admin Portal

Although Frontegg automatically logs Frontegg events, to see those logs you need to turn on the ability to work with those logs.

In your Frontegg Dashboard, go to Self-Service.

Find the Audit Logs switch and toggle to on.


πŸ“˜

You now should see the Audit logs in the Admin Portal.



Configure Audit Log Data Structure

Frontegg comes with a default data structure for displaying and downloading your log data. However, you can customize the data structure. Your log data structure dictates what you see for the logs in the admin portal and in the data you download.

Go to Self-Service β†’ Capabilities β†’ Audit Logs.



In the table you can toggle on and off which fields you want to include in the data. By default, Frontegg tracks certain details for each event.

You can add additional fields to track for the events. Click the add new button and complete the form.



You should see the new field as a column in your table. Each field that you add will be available for each event type you track. Just toggle the field on for each event type for which you want to track that field.

Setup Custom Logging

In addition to tracking the Frontegg default events, you can log other events specific to your application. To add an event to your log, add the code below to your application.

import { AuditsClient } from '@frontegg/client'
// Init the audits SDK with the clientId and api key
const auditsClient = new AuditsClient();
await auditsClient.init('YOUR-CLIENT-ID', 'YOUR-API-KEY');

// Send the actual audit JSON (Match the model below to the one defined on the portal) 
await auditsClient.sendAudit({
    tenantId: 'THE-TENANT-ID', 
    user: '[email protected]', 
    resource: 'Portal', 
    action: 'Login', 
    severity: 'Info',
    ip: '68.132.6.137' 
});
from frontegg import FronteggClient
# Init the audits SDK with the clientId and api key
client = FronteggClient("your-client-id", "your-api-key")

# Send the actual audit JSON (Match the model below to the one defined on the portal) 
client.send_audits(
    {
        user: "[email protected]",
        resource: "Portal",
        action: "Login",
        severity: "Info",
        ip: "68.132.6.137",
    },
    tenantId="THE-TENANT-ID",
)

In your admin portal, you should now be able to see the fully managed audit table with your custom data records you are pushing using "THE-TENANT-ID".


Did this page help you?