You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
('message', 'The message that needs to be logged', 'ANY', FALSE, FALSE),
7
+
('priority', 'The priority which the message should be logged with. Possible values are [''trace'', ''debug'', ''info'', ''warn'', ''error''] and are not case sensitive. If this value is missing or not matching any possible values, the default priority will be ''info''.', 'TEXT', FALSE, TRUE)
8
+
) x;
9
+
10
+
INSERT INTO example(component, description) VALUES
11
+
('log', '
12
+
### Hello World
13
+
14
+
Log a simple ''Hello, World!'' message on page load.
15
+
16
+
```sql
17
+
SELECT ''log'' as component,
18
+
''Hello, World!'' as message
19
+
```
20
+
21
+
Output example:
22
+
23
+
```
24
+
[2025-09-12T08:33:48.228Z INFO sqlpage::log from file "index.sql" in statement 3] Hello, World!
25
+
```
26
+
27
+
### Priority
28
+
29
+
Change the priority to error.
30
+
31
+
```sql
32
+
SELECT ''log'' as component,
33
+
''This is a error message'' as message,
34
+
''error'' as priority
35
+
```
36
+
37
+
Output example:
38
+
39
+
```
40
+
[2025-09-12T08:33:48.228Z ERROR sqlpage::log from file "index.sql" in header] This is a error message
41
+
```
42
+
43
+
### Retrieve user data
44
+
45
+
```sql
46
+
set username = ''user'' -- (retrieve username from somewhere)
47
+
48
+
select ''log'' as component,
49
+
''403 - failed for '' || coalesce($username, ''None'') as output,
50
+
''error'' as priority;
51
+
```
52
+
53
+
Output example:
54
+
55
+
```
56
+
[2025-09-12T08:33:48.228Z ERROR sqlpage::log from file "403.sql" in statement 7] 403 - failed for user
0 commit comments