InvergeDocs
PythonAPI reference

Logs

Structured logging — `trace` / `debug` / `info` / `warn` / `error` / `fatal`.

// access
client.logs

Structured logging — trace / debug / info / warn / error / fatal.

For an app that already uses logging, prefer nexus.NexusLogHandler: attach it once and every logger.info(...) in your codebase lands in Nexus with no call-site changes.

Logs

class

client.logs — buffered by default, like events.

Extends Resource.

View source

log()

method
def log(level, message, *, source=None, context=None, timestamp=None, distinct_id=None, session_key=None, device_key=None, release=None, app_version=None, os_type=None, os_version=None, browser=None, **extra_context) -> None

Write one log line.

client.logs.info("payment started", source="checkout", order_id=42)

Parameters

Prop

Type

View source

trace()

method
def trace(message, **options) -> None

Parameters

Prop

Type

View source

debug()

method
def debug(message, **options) -> None

Parameters

Prop

Type

View source

info()

method
def info(message, **options) -> None

Parameters

Prop

Type

View source

warn()

method
def warn(message, **options) -> None

Parameters

Prop

Type

View source

error()

method
def error(message, **options) -> None

Parameters

Prop

Type

View source

fatal()

method
def fatal(message, **options) -> None

Parameters

Prop

Type

View source

batch()

method
def batch(logs, *, distinct_id=None, session_key=None, device_key=None, release=None, app_version=None, os_type=None, os_version=None, browser=None) -> int

Send many log lines immediately. Returns how many were written.

Parameters

Prop

Type

Returns int

View source

flush()

method
def flush(timeout=None) -> None

Ship everything buffered right now.

Parameters

Prop

Type

View source

warning

alias
warning = warn

Alias of warn.

View source

critical

alias
critical = fatal

Alias of fatal.

View source

On this page