Skip to content

Core API should offer a callback based logging facility #8304

@acmorrow

Description

@acmorrow

Is your feature request related to a problem? Please describe.
The core api offers TRITONSERVER_ServerOptionsSetLogFile to configure logging to a file. However, there doesn't appear to be a way to inject an arbitrary log callback. This makes it difficult to reroute triton's internal logging to some other sort of log consumer. Adding the ability to set an arbitrary logging callback would make it easy to do so.

Describe the solution you'd like
Offer TRITONSERVER_ServerOptionsSetLogCallback which takes a function pointer and userp, then invokes the provided callback with the log metadata and message, along with the userp, so that the implementation can decide how to log.

Describe alternatives you've considered
Creating a UNIX domain socket bound into the file system and setting that as the ServerOptionsSetLogFile, then having a background thread consume it. However, I would lose access to the log metadata like the log level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions