CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/util/db-schema/client-error-log.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Table } from "./types";
7
8
Table({
9
name: "client_error_log",
10
fields: {
11
id: {
12
type: "uuid",
13
desc: "unique identifier for entry (randomly generated)",
14
},
15
event: { type: "string", desc: "arbitrary event label" },
16
error: {
17
type: "string",
18
desc: "the actual error message user saw formatted in JSON",
19
render: { type: "json-string" },
20
},
21
account_id: {
22
type: "uuid",
23
desc: "the account_id of the user",
24
render: {
25
type: "account",
26
},
27
},
28
time: { type: "timestamp", desc: "when user saw the error" },
29
expire: {
30
type: "timestamp",
31
desc: "when to delete this error automatically from the table to save space",
32
},
33
},
34
rules: {
35
desc: "Table used to log errors that clients see in their web browser.",
36
primary_key: "id",
37
durability: "soft", // loss of some log data not serious, since used only for analytics
38
pg_indexes: ["time", "event"],
39
user_query: {
40
get: {
41
admin: true,
42
fields: {
43
id: null,
44
event: null,
45
error: null,
46
account_id: null,
47
time: null,
48
expire: null,
49
},
50
},
51
},
52
},
53
});
54
55