Skip to main content

push_log

Function push_log 

Source
pub async fn push_log(
    client: &impl HttpClient,
    config: &EnvConfig,
    log: &BetterStackLogSchema,
) -> Result<Option<Value>, LogtailError>
Expand description

Pushes a log to the BetterStack logs server asynchronously and returns a value.

§Arguments

  • client - The HTTP client to use for sending the request.
  • config - The configuration of the server.
  • log - The log to be pushed.

§Returns

  • Ok(Some(value)) if the log is sent successfully and a response body is returned.
  • Ok(None) if the log is sent successfully but no response body is returned.
  • Err(LogtailError) if there is an error sending the log.