LogsSupervisor#

class ansys.solutions.dash_super_components.LogsSupervisor(log_file: Path | str, log_format: str, aio_id: str | None = None, interval: int = 3000, width: str | int = '100%', grid_props: dict[str, Any] | None = None, show_error_notifications: bool = True)#

Bases: Div

A Dash component for parsing and displaying log files in an interactive AG Grid table.

LogsSupervisor is based on the Dash All-in-One (AIO) component pattern. It parses log files generated with Python’s logging module and renders them in a sortable, filterable AG Grid table with per-level filter buttons and an optional real-time monitoring toggle.

The grid shows contextual no-rows messages depending on parsing outcome:

  • missing source (for example, file not found or URL 404),

  • parse failure or no rows matching the provided format,

  • successful parse with no rows to display.

Optional dmc notifications can be emitted for parse failures.

The log_format must exactly match the formatter used in the logger, for example:

"%(asctime)s - %(levelname)s - %(module)s - %(message)s"

To activate real-time monitoring from a callback use:

LogsSupervisor.ids.activate_monitoring(aio_id)  # Store; set "data" to True

Note

Custom JavaScript assets must be registered for the log level badges and contextual no-rows messages to render correctly. See the Getting Started page for instructions on registering component assets (add_super_components_assets() and external_scripts).

Furthermore, for error notifications to work correctly, a dmc.NotificationContainer must be present in the application layout. By default the container ID is "notification-container"; use configure() to change it.

Parameters:
log_filestr or Path

Path or URL to the log file. Accepts local file paths and HTTP/HTTPS URLs.

log_formatstr

Format string matching the logger’s formatter. Determines which columns are displayed. See Python logging attributes.

aio_idstr, optional

Unique identifier for this component instance. A UUID is generated when not provided.

intervalint, optional

Polling interval in milliseconds when monitoring is active. Default is 3000.

widthstr or int, optional

Width of the component container. CSS string ("70%", "800px") or integer (pixels). Default is "100%".

grid_propsdict, optional

Additional properties forwarded to the AG Grid component.

show_error_notificationsbool, optional

Whether to emit dmc error notifications when parsing fails. Default is True.

IDs

class ansys.solutions.dash_super_components.LogsSupervisor.LogsSupervisorIds#

Bases: AIOIds

Provides IDs for the subcomponents of LogsSupervisor.

classmethod activate_monitoring(aio_id: str | Wildcard) → dict[str, Any]#

Return the ID for the activate monitoring store component.

This component can be used to externally control the activation of the monitoring by setting its data property to True or False.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

Returns:
dict[str, Any]

The unique ID dictionary for the activate monitoring subcomponent.

classmethod critical_button(aio_id: str | Wildcard) → dict[str, Any]#

Return the ID for the critical button component.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

Returns:
dict[str, Any]

The unique ID dictionary for the critical button subcomponent.

classmethod debug_button(aio_id: str | Wildcard) → dict[str, Any]#

Return the ID for the debug button component.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

Returns:
dict[str, Any]

The unique ID dictionary for the debug button subcomponent.

classmethod error_button(aio_id: str | Wildcard) → dict[str, Any]#

Return the ID for the error button component.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

Returns:
dict[str, Any]

The unique ID dictionary for the error button subcomponent.

classmethod info_button(aio_id: str | Wildcard) → dict[str, Any]#

Return the ID for the info button component.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

Returns:
dict[str, Any]

The unique ID dictionary for the info button subcomponent.

classmethod warning_button(aio_id: str | Wildcard) → dict[str, Any]#

Return the ID for the warning button component.

Parameters:
aio_idstr or _Wildcard

The component’s unique identifier.

Returns:
dict[str, Any]

The unique ID dictionary for the warning button subcomponent.