Skip to content

Commit

Permalink
Restructure the Audit log page
Browse files Browse the repository at this point in the history
  • Loading branch information
xuniq committed Jan 22, 2024
1 parent 9e787b4 commit 51c1d26
Show file tree
Hide file tree
Showing 3 changed files with 276 additions and 206 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ groups:
audit_log:
to: file
file: 'audit_tarantool.log'
filter: [ user_create,data_operations,ddl ]
filter: [user_create,data_operations,ddl,custom]
format: json
spaces: [ bands ]
spaces: [bands]
extract_key: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- myapp.lua --
local audit = require('audit')

-- Log message string
audit.log('Hello, Alice!')
-- Log format string and arguments
audit.log('Hello, %s!', 'Bob')
-- Log table with audit log field values
audit.log({type = 'custom_hello', description = 'Hello, World!'})
audit.log({type = 'custom_farewell', user = 'eve', module = 'custom', description = 'Farewell, Eve!'})
-- Create a new log module
local my_audit = audit.new({type = 'custom_hello', module = 'my_module'})
my_audit:log('Hello, Alice!')
my_audit:log({tag = 'admin', description = 'Hello, Bob!'})
-- Log 'Hello!' message with the VERBOSE severity level
audit.log({severity = 'VERBOSE', description = 'Hello!'})

-- Log 'Hello!' message with a shortcut helper function
audit.verbose('Hello!')

-- Like audit.log(), a shortcut helper function accepts a table of options
audit.verbose({description = 'Hello!'})

-- Severity levels are available for custom loggers
local my_logger = audit.new({module = 'my_module'})
my_logger:log({severity = 'ALARM', description = 'Alarm'})
my_logger:alarm('Alarm')

-- Overwrite session_type and remote fields
audit.log({type = 'custom_hello', description = 'Hello!',
session_type = 'my_session', remote = 'my_remote'})
Loading

0 comments on commit 51c1d26

Please sign in to comment.