Problem
- We want to reuse existing Bublik UI to display logs locally
- We already can export logs as JSON but we also need way to navigate between logs locally
- For it we need to create JSON representation of the tree of logs

Solution
- Output JSON logs to a folder with
tree.json which would act as a manifest for logs
- Locally you can install special executable to open and navigate logs just like in Bublik
- Current proof of concept is at https://github.com/okt-limonikas/bublik-log-viewer
How it works
- User can install executable to view local logs (refer to README.md for instructions on how to install)
- User can update executable via command
Current API includes 2 main commands:
Example
You can see example at https://github.com/okt-limonikas/bublik-log-viewer/tree/main/example/logs
- Basically folder contains mostly logs in the form of files like
node_id1269601.json
- Also contains
tree.json which acts like manifest
This tree.json is following this JSON schema:
You can omit 'start' field in example
{
"type": "object",
"properties": {
"main_package": { "type": "number" },
"tree": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"id": { "type": "number" },
"name": { "type": "string" },
"entity": { "type": "string", "enum": ["pkg", "session", "test"] },
"has_error": { "type": "boolean" },
"skipped": { "type": "boolean" },
"start": { "type": "string" },
"children": { "type": "array", "items": { "type": "number" } }
},
"required": ["id", "name", "entity", "has_error", "skipped", "start"],
"additionalProperties": false
}
}
},
"required": ["main_package", "tree"],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
Here's example of this tree: https://github.com/okt-limonikas/bublik-log-viewer/blob/main/example/logs/tree.json
Run example
If you want to test this out fastest way is using docker:
- Clone repo
git clone git@github.com:okt-limonikas/bublik-log-viewer.git
- Build
docker build -t log-viewer .
- Serve logs from example json folder
docker run -it -v $(pwd)/example/logs:/root/json -p 5050:5050 log-viewer
- Visit http://127.0.0.1:5050 to view logs
Problem
Solution
tree.jsonwhich would act as a manifest for logsHow it works
Current API includes 2 main commands:
bublik-log-viewer serve <path_to_logs_folder> --openThis will spin up http server and open browser to view JSON logs from provided folder
bublik-log-viewer update-> to update to latest versionExample
You can see example at https://github.com/okt-limonikas/bublik-log-viewer/tree/main/example/logs
node_id1269601.jsontree.jsonwhich acts like manifestThis
tree.jsonis following this JSON schema:{ "type": "object", "properties": { "main_package": { "type": "number" }, "tree": { "type": "object", "additionalProperties": { "type": "object", "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "entity": { "type": "string", "enum": ["pkg", "session", "test"] }, "has_error": { "type": "boolean" }, "skipped": { "type": "boolean" }, "start": { "type": "string" }, "children": { "type": "array", "items": { "type": "number" } } }, "required": ["id", "name", "entity", "has_error", "skipped", "start"], "additionalProperties": false } } }, "required": ["main_package", "tree"], "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#" }Here's example of this tree: https://github.com/okt-limonikas/bublik-log-viewer/blob/main/example/logs/tree.json
Run example
If you want to test this out fastest way is using docker:
git clone git@github.com:okt-limonikas/bublik-log-viewer.gitdocker build -t log-viewer .docker run -it -v $(pwd)/example/logs:/root/json -p 5050:5050 log-viewer