cmem_client.models.logs¤
Corporate Memory log buffer models.
Models for the in-memory log buffer API of a Corporate Memory service
(GET /api/admin/logs and GET /api/admin/logs/status). Each instance of a
service keeps its own buffer and answers only with its own lines, which is why
the responses carry an instance identifier and a per instance sequence number.
Classes:
- LogBufferStatus – State and configuration of the in-memory log buffer of one instance.
- LogLevel – Log level a line can be requested at, ordered from least to most severe.
- LogLine – A single buffered log line.
- LogTailResponse – The most recent buffered log lines of one instance, with the state of that read.
LogBufferStatus¤
Bases: Model
State and configuration of the in-memory log buffer of one instance.
Attributes:
- enabled (
bool) – Whether the buffer is enabled in this deployment. - attached (
bool) – Whether the buffer is attached to the logging framework and therefore actually capturing. - capture_level (
str | None) – The minimum level which is captured, regardless of the configured logging levels. - capacity (
int) – How many lines the buffer holds before the oldest ones are discarded. - max_message_chars (
int) – Length a message is truncated to before it is buffered. - size (
int) – How many lines are buffered at the moment. - first_sequence (
int) – Oldest sequence still buffered. - last_sequence (
int) – Highest sequence buffered. - instance_id (
str) – The instance this status describes. - excluded_loggers (
list[str]) – Loggers which are never captured, because they carry user data or credentials. - non_additive_loggers (
list[str]) – Loggers which do not propagate to the buffer through their parent. - request_id_mdc_key (
str | None) – The mapped diagnostic context key the correlation identifier is taken from.
attached¤
capacity¤
capture_level¤
enabled¤
excluded_loggers¤
first_sequence¤
instance_id¤
last_sequence¤
max_message_chars¤
model_config¤
non_additive_loggers¤
request_id_mdc_key¤
size¤
LogLevel¤
Bases: StrEnum
Log level a line can be requested at, ordered from least to most severe.
The level of a request is a minimum: asking for WARN returns the lines logged at WARN as well as the ones logged at ERROR.
Attributes:
DEBUG¤
ERROR¤
INFO¤
TRACE¤
WARN¤
LogLine¤
Bases: Model
A single buffered log line.
Attributes:
- sequence (
int) – Position of this line in the log stream of the answering instance. - timestamp (
datetime) – When the line was logged. - level (
str) – Level the line was logged at. Not restricted to LogLevel, because a service may log at a level which cannot be requested. - logger (
str) – Name of the logger which produced the line. - thread (
str | None) – Thread the line was logged on, if the service reported one. - message (
str) – The log message. - throwable (
str | None) – The rendered exception, if the line carried one. - request_id (
str | None) – Correlation identifier of the request which produced this line. The same value is returned in the X-Request-Id header and, for a failed request, in its problem detail. Lines logged off the request thread carry none.
level¤
logger¤
message¤
model_config¤
request_id¤
sequence¤
thread¤
throwable¤
timestamp¤
LogTailResponse¤
Bases: Model
The most recent buffered log lines of one instance, with the state of that read.
Attributes:
- server_time (
int) – Epoch milliseconds the response was assembled at. - instance_id (
str) – The instance which answered. Sequence numbers are only meaningful together with this value. - first_sequence (
int) – Oldest sequence still buffered. - last_sequence (
int) – Highest sequence examined. Pass it as thesinceof the next request to receive only what has been logged in between. - truncated (
bool) – Whether the limit cut the result short. - dropped (
int) – How many lines were lost between the requestedsinceand what the buffer still holds. - lines (
list[LogLine]) – The matching lines, oldest first.