Skip to content

Audit log ​

Every staff action, setting change, permission change, ban, warn, kick and report is written to the audit log. Other resources forward their own entries into it, so one log covers the whole server.

Audit log

Viewing ​

The Audit log view (np_admin.logs.view) filters by:

Filter
Category ban, kick, warn, perms, settings, report, join, the action categories, or a resource name such as np_inventory
Staff member An identifier (or console) matches exactly; any other text searches the name
Target Same as staff member
Resource The resource that wrote the entry
Search Free text

The dashboard shows the newest entries as a live feed, and the player detail shows a player's entries as a history timeline. Report context is taken from the same log.

Storage ​

  • Entries are queued and written in batches every Config.Logs.flushInterval ms (4 s), and when np_admin stops.
  • Rows older than Config.Logs.retentionDays (90) are deleted on start. 0 keeps everything.
  • Joins and drops are logged as category join unless Config.Logs.joins = false.

Discord routing ​

Categories can be sent to Discord as well:

lua
Config.Logs = {
  discord = { ban = 'admin', kick = 'admin', warn = 'admin', perms = 'admin', settings = 'admin', report = 'reports' },
}
  • With np_discord running, each listed category goes to that np_discord log channel (exports.np_discord:Log).
  • Without np_discord, np_admin posts to the webhook in the convar np_admin_webhook_<category>:
    cfg
    set np_admin_webhook_ban "https://discord.com/api/webhooks/…"
  • Categories without a channel or convar stay in the database only.

Forwarded logs ​

Resources that integrate call npAdmin.log(category, entry). The category is the resource name. Their own Discord webhook keeps working as a fallback when np_admin isn't running.

Resource Category
np_inventory np_inventory
np_character np_character
np_tattoos np_tattoos
np_identification np_identification
np_manufacturing np_manufacturing
np_phone np_phone (staff moderation)
np_helicam np_helicam (finished missions)
np_flightradar np_flightradar (emergency squawks)
np_screens np_screens

To forward your own resource's logs, see Integrating a resource.