mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-24 23:10:24 +02:00
added logs truncate endpoint
This commit is contained in:
1 parent
1a5f29818c
commit
e71be7194a
15 files changed
+201
-21
No files matched your search
+12
-4
@@ -19,9 +19,12 @@ export function logsList(logsSettings) {
|
||||
},
|
||||
get paddedDefaultLogLevels() {
|
||||
const result = [];
|
||||
for (let level in app.utils.logLevels) {
|
||||
|
||||
const sorted = Object.keys(app.utils.logLevels).sort();
|
||||
for (const level of sorted) {
|
||||
result.push(("" + level).padStart(2, " ") + ": " + app.utils.logLevels[level].label);
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
});
|
||||
@@ -133,11 +136,16 @@ export function logsList(logsSettings) {
|
||||
if (log.data.referer && !log.data.referer.includes(window.location.host)) {
|
||||
keys.push({ key: "referer" });
|
||||
}
|
||||
} else {
|
||||
// extract the first 6 keys (excluding the error and details)
|
||||
} else if (keys.length < 6) {
|
||||
// extract the first 6 keys (excluding the error, details and system truncate keys)
|
||||
const allKeys = Object.keys(log.data);
|
||||
for (const key of allKeys) {
|
||||
if (key != "error" && key != "details" && keys.length < 6) {
|
||||
if (
|
||||
keys.length < 6
|
||||
&& key != "error"
|
||||
&& key != "details"
|
||||
&& key != "__pb_truncated__"
|
||||
) {
|
||||
keys.push({ key });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user