InvergeDocs
PythonAPI reference

NexusLogHandler

Forward Python `logging` records to Nexus.

from nexus import NexusLogHandler

Forward Python logging records to Nexus.

Attach it once and every logger.info(...) already in your codebase shows up in Nexus — no call-site changes:

import logging, nexus

client = nexus.init("nxs_live_xxx")
logging.getLogger().addHandler(nexus.NexusLogHandler(client, level=logging.INFO))

Records carrying exc_info are also reported to error monitoring, so a plain logger.exception("...") produces a grouped, stack-traced issue.

SymbolKindSummary
NexusLogHandlerclassA logging handler that writes to the Nexus logs product.
install_logging()functionAttach a NexusLogHandler to a logger (the root by default).

NexusLogHandler

class

A logging handler that writes to the Nexus logs product.

Extends logging.Handler.

View source

NexusLogHandler

constructor
NexusLogHandler(client=None, level=logging.NOTSET, *, capture_errors=True, include_extra=True, source=None)

Parameters

Prop

Type

View source

emit()

method
def emit(record) -> None

Parameters

Prop

Type

View source

Functions

install_logging()

function
def install_logging(client=None, *, level=logging.INFO, logger_name='', **options) -> NexusLogHandler

Attach a NexusLogHandler to a logger (the root by default).

Returns the handler so you can removeHandler it later.

Parameters

Prop

Type

Returns NexusLogHandler

View source

On this page