Skip to content

Log Management

ArchSmith provides built-in logging for both user operations and login attempts, enabling audit trails and security monitoring.

Operation Logs

Features

  • Automatic logging of CRUD operations
  • Records operator, action, request parameters, and response
  • Paginated list with search filters
  • Batch delete and clear all

Data Model — SysOperLog (sys_oper_log)

FieldTypeDescription
operIdLongPrimary key
titleStringOperation module name
businessTypeIntegerOperation type (create/update/delete/etc.)
methodStringController method name
requestMethodStringHTTP method (GET/POST/PUT/DELETE)
operUrlStringRequest URL
operIpStringOperator IP address
operLocationStringIP geolocation (via ip2region)
operParamStringRequest parameters (JSON)
jsonResultStringResponse body (JSON)
statusIntegerResult status (0: fail, 1: success)
errorMsgStringError message (if failed)
operNameStringOperator username
operTimeDateTimeOperation timestamp

API Endpoints

MethodEndpointDescription
POST/admin-api/operation-logsList operation logs (paginated)
POST/admin-api/operation-logs/deleteDelete selected logs
POST/admin-api/operation-logs/clearClear all operation logs

Login Logs

Features

  • Records every login attempt (success and failure)
  • Captures browser, OS, IP, and geolocation
  • Useful for security auditing and anomaly detection
  • Paginated list with search filters

Data Model — SysLoginLog (sys_login_log)

FieldTypeDescription
loginIdLongPrimary key
usernameStringLogin username
ipaddrStringLogin IP address
loginLocationStringIP geolocation
browserStringBrowser name and version
osStringOperating system
statusIntegerResult (0: fail, 1: success)
msgStringMessage (success or error reason)
loginTimeDateTimeLogin timestamp

Browser and OS detection is powered by the UserAgentUtils library, and IP geolocation uses the offline ip2region database.

API Endpoints

MethodEndpointDescription
POST/admin-api/login-logsList login logs (paginated)
POST/admin-api/login-logs/deleteDelete selected logs
POST/admin-api/login-logs/clearClear all login logs

Log Retention

By default, logs are stored indefinitely. Administrators can:

  • Manually delete specific log entries via the admin panel
  • Clear all logs using the clear endpoint
  • Implement automated cleanup by adding a scheduled task that deletes logs older than a configurable period

Service Layer

  • SysOperLogService — operation log CRUD and query
  • SysLoginLogService — login log CRUD and query
  • Both services use Spring Data JPA repositories with QueryDSL for dynamic filtering

Released under the MIT License.