NAME

Twilio::Rest::Serverless::V1::Service::Environment::Log - The Log resource

SYNOPSIS

my $client = Twilio::Rest::Client->new($account_sid, $auth_token);

for my $log ($client->serverless->v1->services($service_sid)->environments($environment_sid)->logs->read({}, 20)) {
  ...
}
my $log = $client->serverless->v1->services($service_sid)->environments($environment_sid)->logs($sid)->fetch;

DESCRIPTION

A record of an event that occurred related to a function invocation.

This file holds LogList, LogPage, LogContext and LogInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

LogList

Returned by $client->serverless->v1->services($service_sid)->environments($environment_sid)->logs. See also Twilio::ListResource.

read

my @records = $client->serverless->v1->services($service_sid)->environments($environment_sid)->logs->read(\%options, $limit, $page_size);

Retrieve a list of all logs. Returns the records as a list, fetching as many pages as it needs.

The options are:

end_date

The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. A string, or an object with an epoch method. See "iso8601_date_time" in Twilio::Serialize.

function_sid

The SID of the function whose invocation produced the Log resources to read.

start_date

The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. A string, or an object with an epoch method. See "iso8601_date_time" in Twilio::Serialize.

stream

my $stream = $client->serverless->v1->services($service_sid)->environments($environment_sid)->logs->stream(\%options, $limit, $page_size);

Takes the same arguments as "read", and returns a Twilio::Stream.

page

my $page = $client->serverless->v1->services($service_sid)->environments($environment_sid)->logs->page(\%options, $page_size, $page_token, $page_number);

Fetches one page, and returns a Twilio::Page.

get_page

my $page = $client->serverless->v1->services($service_sid)->environments($environment_sid)->logs->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->serverless->v1->services($service_sid)->environments($environment_sid)->logs->get_context($sid);

Returns a LogContext, and makes no request.

LogPage

A Twilio::Page of LogInstance objects.

records_key

build_instance

Used by Twilio::Page.

LogContext

Returned by $client->serverless->v1->services($service_sid)->environments($environment_sid)->logs($sid). It makes no request until one of these methods is called.

fetch

my $log = $client->serverless->v1->services($service_sid)->environments($environment_sid)->logs($sid)->fetch;

Retrieve a specific log. Returns a LogInstance.

LogInstance

See also Twilio::InstanceResource.

It has fetch, which work as they do on the context.

Its fields are:

account_sid

The SID of the Account that created the Log resource.

build_sid

The SID of the build that corresponds to the log.

date_created

The date and time in GMT when the Log resource was created specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

deployment_sid

The SID of the deployment that corresponds to the log.

environment_sid

The SID of the environment in which the log occurred.

function_sid

The SID of the function whose invocation produced the log.

level

The log level.

message

The log message.

request_sid

The SID of the request associated with the log.

service_sid

The SID of the Service that the Log resource is associated with.

sid

The unique string that we created to identify the Log resource.

url

The absolute URL of the Log resource.

CONSTRUCTORS

new

Objects here come from the methods above, so there is no need to call new directly.

LICENSE

Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.