Log
The Log widget is a complete Log page. A side panel starts and stops logging, chooses between errors only and all images, shows the disk space, the size of the log and an OK/NOK summary, and clears the log. Next to it, the image grid and detail dialog of Image Log show the logged images; users can select them, download them, and upload them to a dataset. The node does not save images: the flow saves them (for example with rp-save-file) and sends this node the saved file names. The node runs the uploads through dataset-upload, gets the dataset list from list-dataset, and sends an audit message for each user action.
Palette: category Renders, label log. 1 input, 3 outputs.
Compared with Image Log, which has the same grid, dialog, selection and download:
- Entries are built from the files saved by the flow (a list of file names plus
msg.metadata), not received ready-made. The ready-madeimageInputmessage is still accepted. - The node uploads by itself: an upload dialog asks a suffix and a dataset for each image source, and the node drives
dataset-uploadwith progress, stop and one retry. Image Log only sends the image name and leaves the upload to the flow. - It has the side panel, keeps its choices in flow context for the flow's save chain, and keeps them across restarts.
- Upload profiles can limit selection, upload and download to some users.
- Three outputs: dataset upload, audit and dataset list.
- It expects a fixed folder layout under
/opt/storage/imagesand loads the images through fixed URLs.
The widget fills the height of the browser window, with the panel on the left; on screens up to 768 px wide the panel goes above the grid.
Flow and folders
- Folders: the Images folder (default
/opt/storage/images/log/imageShowDir) holds the display copies; the sibling folderimageSaveDir(default/opt/storage/images/log/imageSaveDir) holds the originals that are uploaded. The node keeps one JSON per image in<Images folder>/metadata, as Image Log does: an entry stays while the Images folder has files of that image. - File names:
<name>_<type>.<ext>, masks<name>_<type>_mask.<ext>, with<name>equal tomsg.metadata.nameand free of_. Uploading and clearing handlepng,jpg,jpeg,webp,bmp,tifandtifffiles. - Image URLs: the browser loads each image from
/nodered/local/images/<path>and its thumbnail (400 px) from/nodered/local/fit/400/images/<path>, where<path>is the file's path under/opt/storage/images. This node does not register these routes: the Node-RED installation must serve them. With the Images folder outside/opt/storage/imagesthe thumbnails do not load and Clear log is refused. - Save chain: the node does not decide what is logged. The flow reads
flow.logMode,flow.errorsOnlyandflow.diskLow(see Flow context) and saves only when it should. - Wiring: output 1 to
dataset-upload(with its Config set tomsg.configTraining) and the output ofdataset-uploadback to this node; output 3 tolist-datasetand its output back to this node; output 2 to a switch onmsg.actionthat feeds the matching Audit Manager nodes. - Node.js 18.15 or later, for the disk figures; with older versions the panel shows Not available and
flow.diskLowstaysfalse.
Configuration
| Property | Description | Default |
|---|---|---|
| Name | Node name shown in the editor. | "" |
| Group | Dashboard group that holds the widget (required). | — |
| Locale | Locale Config node with the time zone and date and time format of the dates, and default texts for the footbar. Empty: the browser's format, 24-hour clock, and the built-in texts. | "" |
| Size | Width and height of the widget; 0 fits the group. | 0 / 0 |
| Close button text | Text of the button that closes the image dialog. | Close |
| Show mask checkbox | Shows the MASK checkbox in the dialog footbar. | on |
| Show bbox checkbox | Shows the BBOX checkbox. | on |
| Show polygon checkbox | Shows the POLYGONS checkbox. | on |
| Mask checkbox text | Label of the MASK checkbox. Empty, or equal to the built-in text: the Locale Config text, else MASK. The same rule applies to the next six texts. | "" |
| Bbox checkbox text | Built-in: BBOX. | "" |
| Polygon checkbox text | Built-in: POLYGONS. | "" |
| Hover label text | Title of the Labels on hover option of the gear menu. Built-in: Labels on hover. | "" |
| Hover label hint | Its subtitle. Built-in: Show a label only while pointing at its detection. | "" |
| Box fill text | Title of the Bounding box fill option. Built-in: Bounding box fill. | "" |
| Box fill hint | Its subtitle. Built-in: Tint the inside of each bounding box. | "" |
| Annotations on thumbnails | Initial state of the Show annotations button; the user's choice is kept in the browser. | on |
| Annotation text size (px) | Size of the detection labels, 0 to 200. 0 uses the fontSize of each detection, or 16. | 16 |
| Images folder | Folder of the display copies; see Flow and folders. Empty: the default. | /opt/storage/images/log/imageShowDir |
| Images per page | Images restored when the node starts and fetched by each Load more, 1 to 200. The log itself has no size limit. The widget shows at most 100 of the images restored on load, so values above 100 hide part of the first page. | 100 |
| Remove after upload | A fully uploaded image leaves the log: its JSON goes at once; 5 minutes later, or on redeploy, its display copies and the originals of the sources that were not uploaded are deleted. Off: the image stays, marked Done. | on |
| Upload profiles | Profile ids, comma separated, of the dashboard users who can select, upload and download images and stop an upload. Empty: everyone. Users are identified by the Audit Manager login; with the field set and no login, nobody can. | "" |
| Image types | Number of Type name rows, 0 to 9. Each row is a <type> of the display copies (a key of imageShow). The first one gives the card thumbnail; the dialog and the download menu list them all. | 0 |
| Upload sources | Number of Source name rows. Each source is a <type> of the originals in imageSaveDir; the upload dialog shows one card per source. Names are saved trimmed and in lower case, and empty rows are dropped. | none |
Log panel
- START LOG / STOP LOG turns logging on or off (
flow.logMode). While on, the panel shows Logging, the filter and the number of images. - Errors only / All images sets
flow.errorsOnly. - A warning, Low disk space: new images are not being logged., appears with less than 10 GB free on the disk of the Images folder (
flow.diskLowis thentrue). - Uploading, during an upload: images processed out of the total, the number failed, and Stop upload (Stopping... while it stops).
- Storage: free and total space of the disk, checked every 30 seconds, and the size of the files in both folders, measured every 5 minutes.
- Summary: total, NOK (
isAnomaloustrue) and OK (the rest) over the whole log, counted in the background after a start, and the date of the last image. - Clear log asks for confirmation, then deletes every JSON in
metadataand every image file in the Images folder andimageSaveDir. It is disabled during an upload. While it runs,flow.logModeisfalseand images that arrive are ignored.
With an empty log the grid explains the three steps (start the log, review, upload) and, when the log is off, offers START LOG.
The log state (default on), the filter (default errors only), the last suffix and dataset of each source and the last dataset list are saved in <userDir>/log-store/<node id>.json and survive restarts.
Uploading images
- A user allowed by Upload profiles selects images and presses Upload. The upload dialog opens and the node asks
list-datasetfor the datasets (output 3). - The dialog has one card per upload source, with Suffix and Dataset, filled with the last choice. UPLOAD needs at least one dataset. Sources left without a dataset are not uploaded. A suffix longer than 60 characters, or a dataset id longer than 200, is dropped.
- Images no longer in the log are answered as not uploaded, and images already uploading are skipped. For each other image the node sends an audit message (output 2).
- The node fills a temporary folder,
<imageSaveDir>/.ui-log-upload-<node id>, with hard links to the originals<name>_<source>.<ext>of the chosen sources, and sendspayload: truewithmsg.configTrainingtodataset-upload(output 1). Images without originals are counted as failed. - For each file confirmed by
dataset-uploadthe node deletes the original fromimageSaveDir. An image is uploaded when all its files went up; its card shows Done and Remove after upload applies. If any file failed, the card goes back to normal. - Uploads requested meanwhile wait and start one second after the current one ends. If
dataset-uploadsends no progress at all for 60 seconds, the node sends the run once more. After another 60 seconds of silence, or 60 seconds of silence once progress has started, it gives up and the unfinished cards go back to normal. - Stop upload drops the waiting uploads, sends
payload: falsetodataset-uploadif the run has started, and ends the run after 15 seconds without progress messages. The unfinished cards go back to normal.
Input
| Message | Meaning |
|---|---|
msg.payload.imageShow (array) and msg.metadata | Images saved by the flow (see below). Ignored while the log is being cleared. |
msg.done (boolean), msg.imagesLeft (number), msg.payload (file path) | Progress from dataset-upload, one message per file. |
msg.options (array of { label, value }), msg.datasetsCount (number) | Dataset list from list-dataset; it fills the Dataset selectors and is saved. |
msg.payload = { action: "imageInput", image } | Adds a ready-made entry, as in Image Log. |
msg.payload = { action: "uploadStatus", name, done } | Marks an upload, as in Image Log. |
A message with a non-array msg.payload.imageShow logs a warning once and is ignored.
For saved images, each element of msg.payload.imageShow is { filename, bbox } (fileName is also read; bbox is optional), for example the result of rp-save-file in multiple mode with Result to set to msg.payload.imageShow. The node starts the entry from msg.metadata, which carries the entry fields (name, date, isAnomalous, tag, result, ocr, resume). For each file it takes the text after the first _ of the file name, without the extension, as the image type, and sets imageData and imageDataThumbnail to the image URLs (a _mask file sets imageDataThumbnailMask), plus the element's bbox. Incoming images are not filtered: the flow decides what to send.
Output
Output 1, dataset-upload: starts an upload run.
{
payload: true,
configTraining: [
{
sourceName: "raw",
suffix: "line2", // null when empty
dataset: "<dataset id>",
folder: "/opt/storage/images/log/imageSaveDir/.ui-log-upload-<node id>"
}
]
}There is one entry per source that has a dataset. { payload: false } stops the run.
Output 2, audit: one message per user action, with msg._client (the dashboard user) when the dashboard provides it.
msg.action | Sent when | Other fields |
|---|---|---|
log_start / log_stop | The log is turned on or off. | topic: "logMode", payload: true / false |
log_show_errors | The filter changes. | topic: "errorsOnly", payload: true (errors only) or false |
log_image_upload | An image is queued for upload; one message per image. | payload: the image name |
log_stop_upload | Stop upload is accepted. | — |
log_clear | Clear log starts. | payload: number of images in the log |
Output 3, list-dataset: { payload: "refresh" } each time the upload dialog opens.
Flow context
| Key | Value |
|---|---|
flow.logMode | true while the log is on and not being cleared. |
flow.errorsOnly | true with Errors only, false with All images. |
flow.diskLow | true with less than 10 GB free on the disk of the Images folder. |
Status and errors
The node sets no status. It logs:
| Message | When |
|---|---|
No group configured | Error at deploy: the node has no group and does nothing. |
ui-log: the images folder is outside /opt/storage/images, thumbnails will not load | Warning at deploy. |
ui-log: upload rejected, profile not allowed / ui-log: stopUpload rejected, profile not allowed | The user is not in Upload profiles. |
ui-log: no saved files to upload for <n> images | Those images have no originals of the chosen sources in imageSaveDir. |
ui-log: could not prepare <file>: <reason> | A hard link for the upload could not be made. |
ui-log: could not prepare the upload: <reason> | Error: the upload folder could not be prepared, for example because imageSaveDir does not exist. |
ui-log: no answer from dataset-upload, <n> images not uploaded | dataset-upload stayed silent after the retry. |
ui-log: raw images received; this node does not save them, wire the save chain (rp-save-file) before it | First message with images that were not saved. |
ui-log: could not save settings: <reason> / ui-log: could not read <file>: <reason> | The settings file could not be written (error) or read (warning). |
ui-log: could not clear the log: <reason> | Error during Clear log. |
ui-log: <reason> | Error: a widget action failed. |
Other warnings start with ui-log: could not or ui-log: skipping and name the file or folder, as in Image Log.
The widget shows these notices in the browser that made the request:
| Notice | When |
|---|---|
Select a dataset first | An upload arrives with no dataset chosen. |
Wait for the uploads in progress to finish | Clear log during an upload. |
The images folder is outside /opt/storage/images | Clear log with either folder outside /opt/storage/images. |
<n> files could not be deleted | Clear log ended with files left. |
The log could not be cleared | Clear log failed. |
Usage example
Gate at the start of the save chain, in a function node, so that only what the Log asks for is saved:
if (!flow.get("logMode") || flow.get("diskLow")) return null;
if (flow.get("errorsOnly") && msg.metadata.isAnomalous !== true) return null;
return msg;After the display copies and the originals are saved, the message that reaches the Log node looks like this (Image types: raw; Upload sources: raw):
msg.payload = {
imageShow: [
{
filename: "1718000000000_raw.jpg",
bbox: [
{ x_rel: 0.12, y_rel: 0.30, w_rel: 0.20, h_rel: 0.15, tag: "scratch", score: 0.93 }
]
},
{ filename: "1718000000000_raw_mask.png" }
]
};
msg.metadata = {
name: "1718000000000",
date: "2026-11-22T10:30:00.000Z",
isAnomalous: true,
tag: "scratch",
result: "Scratch on cap",
resume: { "cap-detector": { result: "NOK", score: 0.93 } }
};
return msg;Here 1718000000000_raw.jpg and 1718000000000_raw_mask.png are in the Images folder and 1718000000000_raw.jpg is in imageSaveDir.