Skip to content

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-made imageInput message 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-upload with 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/images and 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 folder imageSaveDir (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 to msg.metadata.name and free of _. Uploading and clearing handle png, jpg, jpeg, webp, bmp, tif and tiff files.
  • 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/images the 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.errorsOnly and flow.diskLow (see Flow context) and saves only when it should.
  • Wiring: output 1 to dataset-upload (with its Config set to msg.configTraining) and the output of dataset-upload back to this node; output 3 to list-dataset and its output back to this node; output 2 to a switch on msg.action that 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.diskLow stays false.

Configuration ​

PropertyDescriptionDefault
NameNode name shown in the editor.""
GroupDashboard group that holds the widget (required).—
LocaleLocale 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.""
SizeWidth and height of the widget; 0 fits the group.0 / 0
Close button textText of the button that closes the image dialog.Close
Show mask checkboxShows the MASK checkbox in the dialog footbar.on
Show bbox checkboxShows the BBOX checkbox.on
Show polygon checkboxShows the POLYGONS checkbox.on
Mask checkbox textLabel 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 textBuilt-in: BBOX.""
Polygon checkbox textBuilt-in: POLYGONS.""
Hover label textTitle of the Labels on hover option of the gear menu. Built-in: Labels on hover.""
Hover label hintIts subtitle. Built-in: Show a label only while pointing at its detection.""
Box fill textTitle of the Bounding box fill option. Built-in: Bounding box fill.""
Box fill hintIts subtitle. Built-in: Tint the inside of each bounding box.""
Annotations on thumbnailsInitial 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 folderFolder of the display copies; see Flow and folders. Empty: the default./opt/storage/images/log/imageShowDir
Images per pageImages 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 uploadA 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 profilesProfile 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 typesNumber 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 sourcesNumber 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.diskLow is then true).
  • 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 (isAnomalous true) 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 metadata and every image file in the Images folder and imageSaveDir. It is disabled during an upload. While it runs, flow.logMode is false and 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 ​

  1. A user allowed by Upload profiles selects images and presses Upload. The upload dialog opens and the node asks list-dataset for the datasets (output 3).
  2. 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.
  3. 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).
  4. 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 sends payload: true with msg.configTraining to dataset-upload (output 1). Images without originals are counted as failed.
  5. For each file confirmed by dataset-upload the node deletes the original from imageSaveDir. 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.
  6. Uploads requested meanwhile wait and start one second after the current one ends. If dataset-upload sends 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.
  7. Stop upload drops the waiting uploads, sends payload: false to dataset-upload if the run has started, and ends the run after 15 seconds without progress messages. The unfinished cards go back to normal.

Input ​

MessageMeaning
msg.payload.imageShow (array) and msg.metadataImages 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.

js
{
    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.actionSent whenOther fields
log_start / log_stopThe log is turned on or off.topic: "logMode", payload: true / false
log_show_errorsThe filter changes.topic: "errorsOnly", payload: true (errors only) or false
log_image_uploadAn image is queued for upload; one message per image.payload: the image name
log_stop_uploadStop upload is accepted.—
log_clearClear log starts.payload: number of images in the log

Output 3, list-dataset: { payload: "refresh" } each time the upload dialog opens.

Flow context ​

KeyValue
flow.logModetrue while the log is on and not being cleared.
flow.errorsOnlytrue with Errors only, false with All images.
flow.diskLowtrue with less than 10 GB free on the disk of the Images folder.

Status and errors ​

The node sets no status. It logs:

MessageWhen
No group configuredError at deploy: the node has no group and does nothing.
ui-log: the images folder is outside /opt/storage/images, thumbnails will not loadWarning at deploy.
ui-log: upload rejected, profile not allowed / ui-log: stopUpload rejected, profile not allowedThe user is not in Upload profiles.
ui-log: no saved files to upload for <n> imagesThose 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 uploadeddataset-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 itFirst 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:

NoticeWhen
Select a dataset firstAn upload arrives with no dataset chosen.
Wait for the uploads in progress to finishClear log during an upload.
The images folder is outside /opt/storage/imagesClear log with either folder outside /opt/storage/images.
<n> files could not be deletedClear log ended with files left.
The log could not be clearedClear 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:

js
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):

js
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.