Skip to content

Commit 51c1d26

Browse files
committed
Restructure the Audit log page
1 parent 9e787b4 commit 51c1d26

File tree

3 files changed

+276
-206
lines changed

3 files changed

+276
-206
lines changed

doc/code_snippets/snippets/config/instances.enabled/audit_log/config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ groups:
1010
audit_log:
1111
to: file
1212
file: 'audit_tarantool.log'
13-
filter: [ user_create,data_operations,ddl ]
13+
filter: [user_create,data_operations,ddl,custom]
1414
format: json
15-
spaces: [ bands ]
15+
spaces: [bands]
1616
extract_key: true
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
-- myapp.lua --
2+
local audit = require('audit')
3+
4+
-- Log message string
5+
audit.log('Hello, Alice!')
6+
-- Log format string and arguments
7+
audit.log('Hello, %s!', 'Bob')
8+
-- Log table with audit log field values
9+
audit.log({type = 'custom_hello', description = 'Hello, World!'})
10+
audit.log({type = 'custom_farewell', user = 'eve', module = 'custom', description = 'Farewell, Eve!'})
11+
-- Create a new log module
12+
local my_audit = audit.new({type = 'custom_hello', module = 'my_module'})
13+
my_audit:log('Hello, Alice!')
14+
my_audit:log({tag = 'admin', description = 'Hello, Bob!'})
15+
-- Log 'Hello!' message with the VERBOSE severity level
16+
audit.log({severity = 'VERBOSE', description = 'Hello!'})
17+
18+
-- Log 'Hello!' message with a shortcut helper function
19+
audit.verbose('Hello!')
20+
21+
-- Like audit.log(), a shortcut helper function accepts a table of options
22+
audit.verbose({description = 'Hello!'})
23+
24+
-- Severity levels are available for custom loggers
25+
local my_logger = audit.new({module = 'my_module'})
26+
my_logger:log({severity = 'ALARM', description = 'Alarm'})
27+
my_logger:alarm('Alarm')
28+
29+
-- Overwrite session_type and remote fields
30+
audit.log({type = 'custom_hello', description = 'Hello!',
31+
session_type = 'my_session', remote = 'my_remote'})

0 commit comments

Comments
 (0)