Using Audit Logs as a Service to Your Advantage

Using Audit Logs as a Service to Your Advantage's photo

Published on Nov 19, 2021

Subscribe to my newsletter and never miss my upcoming articles

The audit log procedure is important for your business. Audit log management improves security and accountability and helps meet requirements.

A lot of businesses tend to overlook this conceptualization when they face more urgent issues. To help you stop making this mistake, we will be discussing audit logs and how to take advantage of the opportunity they present.

Verifying your audit log management is very effective as it supports security, accountability, and compliance.

What is an Audit Log?

An audit log or audit trail is a security-relevant document that records an event in a system and shows what information was accessed and how they were modified. It acts as documentary evidence of activities that have been affected any time an operation, procedure, or event occurred.

The advantages of a good audit trail system go way beyond rectifying issues. A good audit log system effectively captures the big picture of the state of your business. Top audit trail systems have visualizations that help you review the state of your business in a nutshell.

A well-detailed audit log helps in improving security and detecting security breaches, gaining insights into users, cutting costs. For this tutorial, we will be using Frontegg's audit logging tool.

Audit Logging with Frontegg

Screenshot 2021-11-18 at 10.27.17 PM.png

Frontegg is a self-service enabler for SaaS app builders that empowers end-users to adopt applications without any human interaction. It will enable your users to control every aspect of their accounts: manage users & teams, define and assign roles & permissions, get visibility through audit logs, subscribe to webhooks, subscription, analytics, and more.

Frontegg provides a fully scalable, customizable, and secure multi-tenant control registry solution. Management oversight and regulatory compliance requirements that any changes to your application be tracked and documented.

Frontegg's advanced audit log provides full visibility into every change made to your application. Supervision of the workflow is simple, with custom views that can easily be exported to multiple formats. By capturing every change made to your product, you can be sure that all changes are documented, keeping you focused on your core business.

To add an audit log, you need to follow the steps below:

Configure The Audit Log Data Structure

To begin, you need to log in to Frontegg, go to your dashboard, and check Secure Acess→Audit Logs→Start Integration.

Here, you can use the default log data structure, or you can tweak it to your purpose, as seen below.

Push Audit Logs

We need to write some code here to push a new data record to the audit log.

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: '', 
    resource: 'Portal', 
    action: 'Login', 
    severity: 'Info',
    ip: '' 

Note: the above code works exclusively for Node JS. If you want to see other languages that are supported, check their documentation.

Here you should see a full managed audit table on your Admin Dashboard.

Automatic Audit Logs

As a part of Frontegg's user control system, every user activity (sign up, log in, log out, crew invites, etc.) is audited automatically. So your customers have traceability for each motion completed in your application. This allows you to have the capacity to ship your very own custom audits and complete a full audit log solution.

Challenges of Log Management

Log management is not capable of differentiating between good and bad activity. The traditional purpose of log management is collecting data. It does not state the difference between normal business activity results and malicious activity.

A majority of the systems used for log management are automated. The logs are generated by machines for central storage. The result is piles of logs awaiting the attention of a human to carry out an investigation against digital threats.

Unfortunately, a lot of businesses have skipped this important step.

Failure to perform this step can lead to a massive accumulation of logs leading to unchallenged potential security events taking place on the servers. Proper and standard log management requires recourses, expertise, and time. This is the only way to perform the process properly and receive optimal benefits.

When you collect your logs from the cloud, do not presume your data will be collected, and your activity will be monitored by cloud services. This misunderstanding has triggered a lot of unnecessary confusion.


For every business, there has to be a risk management strategy that helps absorb some shocks in processes. Audit logs play an important role here as they let you show others the steps you are taking to prevent an issue before it occurs. This gives investors more confidence to invest in your product.

Considering the huge benefits of audit logs, you should pick the right tool for you and start utilizing audit logs. Happy Coding!!

Cover Photo by Kevin Ku on Unsplash

Share this