PythonAPI reference
NexusLogHandler
Forward Python `logging` records to Nexus.
from nexus import NexusLogHandlerForward 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.
| Symbol | Kind | Summary |
|---|---|---|
NexusLogHandler | class | A logging handler that writes to the Nexus logs product. |
install_logging() | function | Attach a NexusLogHandler to a logger (the root by default). |
NexusLogHandler
classA logging handler that writes to the Nexus logs product.
Extends logging.Handler.
NexusLogHandler
constructorNexusLogHandler(client=None, level=logging.NOTSET, *, capture_errors=True, include_extra=True, source=None)Parameters
Prop
Type
emit()
methoddef emit(record) -> NoneParameters
Prop
Type
Functions
install_logging()
functiondef install_logging(client=None, *, level=logging.INFO, logger_name='', **options) -> NexusLogHandlerAttach a NexusLogHandler to a logger (the root by default).
Returns the handler so you can removeHandler it later.
Parameters
Prop
Type
Returns NexusLogHandler
