Google is committed to advancing racial equity for Black communities. See how.

fuchsia.logger

PROTOCOLS

Log

Defined in fuchsia.logger/logger.fidl

Interface for LogListenerSafe to register to listen to logs.

DumpLogs

Request

NameType
log_listener LogListener
options LogFilterOptions?

DumpLogsSafe

Dumps all cached logs by calling LogMany() followed by Done() on log_listener. A null options indicates no filtering is requested.

Request

NameType
log_listener LogListenerSafe
options LogFilterOptions?

Listen

Request

NameType
log_listener LogListener
options LogFilterOptions?

ListenSafe

Dumps all cached logs by calling LogMany() in batches followed by Log() for each new log message. A null options indicates no filtering is requested.

Request

NameType
log_listener LogListenerSafe
options LogFilterOptions?

ListenSafeWithSelectors

Listens to new log entries by calling Log() on log_listener. A null options indicates no filtering is requested.

Request

NameType
log_listener LogListenerSafe
options LogFilterOptions?
selectors vector<LogInterestSelector>[5]

LogListener

Defined in fuchsia.logger/logger.fidl

Included temporarily for backwards compatiblity. Use LogListenerSafe.

Done

Request

NameType

Log

Request

NameType
log LogMessage

LogMany

Request

NameType
log vector<LogMessage>

LogListenerSafe

Defined in fuchsia.logger/logger.fidl

A listener who will notify the Log of the receipt of each message.

Done

Called when this listener was passed to DumpLogsSafe() and all cached logs have been sent.

Request

NameType

Log

Called for single messages.

The return value is used for flow control, and implementers should acknowledge receipt of each message in order to continue receiving future messages.

Request

NameType
log LogMessage

Response

NameType

LogMany

Called when serving cached logs.

Max logs size per call is MAX_LOG_MANY_SIZE_BYTES bytes.

The return value is used for flow control, and implementers should acknowledge receipt of each batch in order to continue receiving future messages.

Request

NameType
log vector<LogMessage>

Response

NameType

LogSink

Defined in fuchsia.logger/logger.fidl

Drains a program's logs.

Connect

Send this socket to be drained.

See //zircon/system/ulib/syslog/include/syslog/wire_format.h for what is expected to be received over the socket.

Request

NameType
socket handle<socket>

ConnectStructured

Send this socket to be drained, using the structured logs format.

See //docs/development/logs/encodings.md for what is expected to be recieved over the socket.

Request

NameType
socket handle<socket>

OnInterestChanged

Use OnRegisterInterest instead.

Response

NameType
interest fuchsia.diagnostics/Interest

OnRegisterInterest

LogSink implementers emit this event whenever the scope of their interest changes. Clients are expected to emit messages based on the registered Interest. In the event that an empty interest is conveyed, clients should emit messages based on their default (compile time) configuration.

Response

NameType
interest fuchsia.diagnostics/Interest

STRUCTS

LogFilterOptions

Defined in fuchsia.logger/logger.fidl

NameTypeDescriptionDefault
filter_by_pid bool No default
pid uint64 No default
filter_by_tid bool No default
tid uint64 No default
verbosity uint8

If more than zero, logs would be filtered based on verbosity and min_severity would be ignored.

No default
min_severity LogLevelFilter

Severity used as threshold to determine logging level.

No default
tags vector<string>[5]

If non-empty, return all messages which contain at least one specified tag. If empty, messages will not be filtered by tag. Passed tags should not be more than MAX_TAG_LEN_BYTES bytes in length and max tags can be MAX_TAGS. Listener would be discarded if the limit is not followed.

No default

LogInterestSelector

Defined in fuchsia.logger/logger.fidl

Conveyance to couple a specified Interest with it's designated target, specified via a ComponentSelector.

NameTypeDescriptionDefault
selector fuchsia.diagnostics/ComponentSelector No default
interest fuchsia.diagnostics/Interest No default

LogMessage

Defined in fuchsia.logger/logger.fidl

NameTypeDescriptionDefault
pid uint64 No default
tid uint64 No default
time zx/time

https://fuchsia.dev/fuchsia-src/reference/syscalls/clock_get_monotonic.md

No default
severity int32 No default
dropped_logs uint32

See //zircon/system/ulib/syslog/include/syslog/wire_format.h. As messages can be served out of order, this should only be logged if more than last count.

No default
tags vector<string>[5] No default
msg string[32768] No default

ENUMS

LogLevelFilter

Type: int8

Defined in fuchsia.logger/logger.fidl

Log levels used with log related filtering. Filtering uses a heuristic based on a threshold of minimum severity level - with any log equal to or greater than the threshold being included in the printable logs.

NameValueDescription
DEPRECATED_NONE -1
DEPRECATED_INFO 0
DEPRECATED_WARN 1
DEPRECATED_ERROR 2
DEPRECATED_FATAL 3
ALL -127
TRACE 16
DEBUG 32
INFO 48
WARN 64
ERROR 80
FATAL 96
NONE 127

CONSTANTS

NameValueTypeDescription
LOG_LEVEL_DEFAULT 48 uint8

Default log level used to initialize loggers.

LOG_SEVERITY_MAX_STEP 6 uint8

Maximum available log severity.

LOG_SEVERITY_STEP_SIZE 16 uint8

The interval between discrete log severity levels

LOG_VERBOSITY_STEP_SIZE 1 uint8

The interval between discrete log verbosity levels

MAX_DATAGRAM_LEN_BYTES 32768 uint32

Max byte size for message payload.

MAX_LOG_MANY_SIZE_BYTES 16384 uint64

Max log bytes per call to a listener.

MAX_LOG_SELECTORS 5 uint8

Max number of LogInterestSelectors that can be specified via a listener.

MAX_TAGS 5 uint8

Max number of tags that can be passed to filter by listener.

MAX_TAGS_PER_LOG_MESSAGE 5 uint8

Max tags that will be attached to a LogMessage.

MAX_TAG_LEN_BYTES 63 uint8

Max tag length that can be passed to filter by listener.