
Company News
AWS Security Hub Adds Socket for Supply Chain Security
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.
@abpjs/audit-logging
Advanced tools
ABP Framework audit-logging components for React - translated from @volo/abp.ng.audit-logging
Audit logging UI components for ABP Framework in React
@abpjs/audit-logging provides audit log viewing and management components for ABP-based React applications. It allows administrators to view, search, and filter audit logs with detailed information about user actions.
This package is a React translation of the original @volo/abp.ng.audit-logging Angular package.
# Using npm
npm install @abpjs/audit-logging
# Using yarn
yarn add @abpjs/audit-logging
# Using pnpm
pnpm add @abpjs/audit-logging
This package requires the following peer dependencies:
npm install @abpjs/core @abpjs/theme-shared @chakra-ui/react @emotion/react react-router-dom
import { AuditLogsComponent } from '@abpjs/audit-logging';
function AuditLogsPage() {
return (
<AuditLogsComponent
onAuditLogSelected={(log) => console.log('Selected:', log)}
/>
);
}
import { useAuditLogs } from '@abpjs/audit-logging';
import { useEffect } from 'react';
function CustomAuditLogsView() {
const {
auditLogs,
totalCount,
isLoading,
error,
fetchAuditLogs,
getAuditLogById,
selectedAuditLog,
} = useAuditLogs();
useEffect(() => {
fetchAuditLogs();
}, [fetchAuditLogs]);
return (
<div>
<h1>Audit Logs ({totalCount})</h1>
<ul>
{auditLogs.map(log => (
<li key={log.id}>
{log.httpMethod} {log.url} - {log.httpStatusCode}
</li>
))}
</ul>
</div>
);
}
Complete audit log management component with table, search, filters, and detail modal.
import { AuditLogsComponent } from '@abpjs/audit-logging';
<AuditLogsComponent
onAuditLogSelected={(log) => console.log('Selected:', log)}
/>
Props:
| Prop | Type | Required | Description |
|---|---|---|---|
onAuditLogSelected | (log: AuditLog) => void | No | Callback when an audit log is selected |
Features:
Hook for fetching and managing audit logs.
import { useAuditLogs } from '@abpjs/audit-logging';
const {
auditLogs, // Array of audit logs
totalCount, // Total count for pagination
selectedAuditLog, // Currently selected audit log
isLoading, // Loading state
error, // Error message
pageQuery, // Current pagination/filter params
fetchAuditLogs, // Fetch audit logs with optional params
getAuditLogById, // Get and select an audit log by ID
setSelectedAuditLog, // Set the selected audit log
setPageQuery, // Update pagination/filter params
reset, // Reset state
} = useAuditLogs();
Service class for audit logging API operations.
import { AuditLoggingService } from '@abpjs/audit-logging';
import { useRestService } from '@abpjs/core';
function MyComponent() {
const restService = useRestService();
const service = new AuditLoggingService(restService);
// Fetch audit logs
const logs = await service.getAuditLogs({
maxResultCount: 10,
skipCount: 0,
startTime: '2024-01-01',
endTime: '2024-01-31',
});
// Get single audit log
const log = await service.getAuditLogById(id);
}
interface AuditLog {
id: string;
applicationName: string;
userId: string;
userName: string;
tenantId: string;
tenantName: string;
impersonatorUserId: string;
impersonatorTenantId: string;
executionTime: string;
executionDuration: number;
clientIpAddress: string;
clientName: string;
clientId: string;
correlationId: string;
browserInfo: string;
httpMethod: string;
url: string;
exceptions: string;
comments: string;
httpStatusCode: number;
entityChanges: EntityChange[];
actions: AuditLogAction[];
}
interface EntityChange {
id: string;
auditLogId: string;
tenantId: string;
changeTime: string;
changeType: number;
entityId: string;
entityTypeFullName: string;
propertyChanges: EntityPropertyChange[];
}
interface AuditLogAction {
id: string;
auditLogId: string;
tenantId: string;
serviceName: string;
methodName: string;
parameters: string;
executionTime: string;
executionDuration: number;
}
Default route configuration for the audit logging module:
import { AUDIT_LOGGING_ROUTES } from '@abpjs/audit-logging';
// Use in your router configuration
const routes = [
...AUDIT_LOGGING_ROUTES.routes,
// your other routes
];
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { AuditLogsComponent } from '@abpjs/audit-logging';
function App() {
return (
<BrowserRouter>
<Routes>
<Route path="/audit-logs" element={<AuditLogsComponent />} />
</Routes>
</BrowserRouter>
);
}
This package respects ABP's audit logging permissions:
| Permission | Description |
|---|---|
AuditLogging.AuditLogs | View audit logs |
This package is part of the ABP React monorepo. Contributions are welcome!
LGPL-3.0 - See LICENSE for details.
FAQs
ABP Framework audit-logging components for React - translated from @volo/abp.ng.audit-logging
The npm package @abpjs/audit-logging receives a total of 31 weekly downloads. As such, @abpjs/audit-logging popularity was classified as not popular.
We found that @abpjs/audit-logging demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.

Research
/Security News
Popular npm packages keyv and cacheable compromised.

Security News
A misconfiguration gave three Anthropic models internet access, and one, believing it was in a simulation, shipped a credential-stealing package to PyPI.