Skip to content

Login & Operation Logs ​

Together the two logs answer the three audit questions: who logged in, who changed what, and did it break. Both are read-only lists with search and export. The delete button appears only for super admins.

Login Log ​

One record per successful login:

FieldDescription
Account / Login Time
IP Address / IP SourceResolved to "Country | Province | City | ISP"
OS / Browser / Device TypeParsed from the User-Agent

IP geolocation uses the bundled offline ip2region database, on by default with no network access. Point erupt.upms.ip2region.path at a newer xdb file, or set enable: false to skip lookups.

Operation Log ​

Records every data write by a user, plus any API annotated with @EruptRecordOperate:

FieldDescription
Operator / IP / IP Source
Function NameSuch as UPDATE | Order Management: operation type, then menu name
Before DataFor edits and deletes, the full object before the change, pretty-printed JSON
Req ParamThe request body or URL parameters submitted
Is Success / Error InfoOn failure the stack trace is saved (truncated to 4000 characters)
Req TimeMilliseconds, sortable, for spotting slow operations
URL / Method

Operation types recorded by default:

TypeTrigger
INSERTAdding data
UPDATEEditing, inline cell edits, batch edits
DELETEDeleting data
FORM-VIEWForm view submissions
Row operationCustom @RowOperation actions, named by their title

Recording Your Own APIs ​

Add @EruptRecordOperate to a REST endpoint and it lands in the operation log:

java
@PostMapping("/sync-order")
@EruptMenuAuth("order_sync")
@EruptRecordOperate("Sync orders")
public R<Void> syncOrder(@RequestBody SyncBody body) { ... }

Configuration ​

yaml
erupt:
  security:
    record-operate-log: true              # false disables recording
    record-operate-log-max-body-size: 1048576  # bodies over 1MB are not buffered

Tenant Isolation ​

2.4.0+

Both log tables (and the online-users view, which maps the login log table) carry a tenant_id column, "0" for the platform, restricted automatically by Hibernate's @TenantId: a tenant administrator opening the logs sees only that tenant's rows, and the platform sees its own. A login happens before the request has a tenant, so the login log row is written explicitly under the user's own tenant rather than the platform's. Without erupt-tenant every log row belongs to the platform and nothing changes; see Multi-tenancy and @TenantId for how it works.

As an Analytics Source ​

EruptLoginLog and EruptOperateLog both carry @EruptCube, with account, IP region, function name and duration already declared as dimensions and measures. With erupt-cube you can drag-and-drop straight away: which function fails most, when logins peak, which operations are slowest. The dataset SQL filters by the session's tenant as well, so a tenant analyses its own logs only.

Contributors

The avatar of contributor named as YuePeng YuePeng

Changelog

Released under the Apache-2.0 License.