Log Collection Plugin
Lets you group log files and folders into named collections and start conversations scoped to them. On the welcome page, a compact Log collections list shows your collections; Analyze attaches the collection to the current conversation while it is still empty (keeping any text, images or other attachments already in the composer) and otherwise opens a new conversation against one. A one-line banner in that conversation shows the attached collection, its sources, and any that are no longer found.
Editing is not admin-only: any signed-in user can create and edit their own collections, and only their own. What paths may be attached is decided by the operator through allowed_log_roots.
Configuration
plugins:
- module: codumentor.plugins.log_collection
class: LogCollectionPlugin
args:
enabled: true
allowed_log_roots:
- /var/log/my-application
Parameters
| Key | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Master switch. |
allowed_log_roots | list of absolute directory paths | [] | Trusted host directories whose regular files (or subfolders) may be attached. Empty denies all attachments. Shown to users in the form so they know where logs may come from. |
Host-file security
This plugin is operator opt-in. Configure narrowly scoped log directories, never
an instance data directory, configuration directory, or the filesystem root.
Every user with access to this plugin can attach files under these roots; the
allowlist is not a per-tenant authorization mechanism. Roots must exist when the
plugin starts. Keep them and their ancestors protected from untrusted writes.
API and agent-tool attachments must resolve to an existing regular file or folder
contained in an allowed root. Symlinks and .. are resolved before containment is
checked; only the canonical path is stored. Collection names and workspace names
must be single safe path components. Persisted entries are revalidated when a
session is prepared: an entry that now resolves outside the allowlist fails the
session closed, while one whose path no longer exists (a rotated-away log) is
skipped and named to the agent as not found.
A folder source is walked when each session is prepared (directory symlinks are
not followed, at most 500 files). Every file in it is checked against the
allowlist on its own, so a symlink inside the folder that points elsewhere is left
out. The sandbox receives individual read-only file mounts, never the folder or
any parent directory; unattached sibling files are not exposed.
The agent tools act only for the collection's owner (the user the session runs
for); other users' collections are reported as not found.
Path checks do not eliminate filesystem replacement races when an attacker can
modify trusted directories. Changing the allowlist does not revoke mounts in
already-running sessions; end those sessions when tightening access.
Isolation modes
| Mode | What the agent sees | Disabled tools |
|---|---|---|
isolated (default) | Only the collection's log files — no code repos | knowledge_search, replace_in_file, write_file, agentic_developer |
merged | Log files plus all configured code repos | — |
Using the UI
- On the welcome page, click + New in the Log collections list
- Set Name (also the folder the agent sees the logs in), optional Description, and Code access (logs only, or logs and code repositories)
- Under Log sources, enter the absolute path of a log file or a folder, optionally with a note for the agent. Clicking an allowed location starts a path there. A folder brings all its files along, so rotated or split logs (
app.log,app.log.1, …) need one entry; new files show up in the next conversation - Create collection, then Analyze
The name the agent sees for a source is the last component of its path (made unique within the collection). Deleting a collection asks for confirmation; existing conversations keep their history. The edit page marks sources that are no longer found or no longer allowed.
Operator API
All routes require authentication and are scoped to the calling user. They are mounted under /ui/plugins/log_collection.
| Method | Path | Description |
|---|---|---|
POST | / | Create a collection |
GET | / | List the caller's collections |
GET | /settings | Allowed log roots and the per-folder file limit |
GET | /conversations/{conversation_id} | The collection a conversation analyzes ({"collection": null} if none) |
PUT | /conversations/{conversation_id} | Attach a collection to the caller's conversation before its first message |
GET | /{id} | Collection details including sources, each with kind, file_count and status (ok, missing, blocked) |
PUT | /{id} | Update name, description, or isolation mode |
DELETE | /{id} | Delete a collection |
POST | /{id}/files | Add files or folders (whole batch or nothing; duplicate names → 409) |
DELETE | /{id}/files/{file_id} | Remove a source |
Create a collection:
curl -X POST http://localhost:2638/ui/plugins/log_collection \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"name": "production-logs", "description": "Prod logs", "isolation_mode": "isolated"}'
Add sources (real_path must resolve to a regular file or folder under allowed_log_roots; symlink_name and label are optional):
curl -X POST http://localhost:2638/ui/plugins/log_collection/1/files \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"files": [
{"real_path": "/var/log/my-application/app.log", "label": "Main application log"},
{"real_path": "/var/log/my-application/archive"}
]
}'
Start a conversation against a collection:
curl -X POST "http://localhost:2638/ui/conversations?source_type=log_collection&source_id=1" \
-H "Authorization: Bearer $TOKEN"
Agent tools
During a log-collection conversation the agent can manage collections:
manage_log_collection— create, list, get, update, or delete collectionsmanage_log_collection_files— add (file or folder), list, or remove sources in a collection
Changes take effect in new conversations.
Troubleshooting
Widget missing. Confirm the plugin is in plugins with enabled: true.
404 on a collection API call. The collection must belong to the authenticated user and the id must exist.
Agent cannot read a log file. Configure allowed_log_roots; its empty default denies all (the form then says log access is not set up). real_path must resolve to an existing file or folder inside an allowed root and be readable by the Codumentor process. Entries that now resolve outside the allowlist must be removed before starting another session; entries marked not found are just skipped.