get_container_log
async
¶
get_container_log(
service_name: ContainerServiceName,
container_name: string,
*,
config_overrides: Optional[AsyncLightsailClientConfig] = None,
start_time: Optional[IsoDate] = None,
end_time: Optional[IsoDate] = None,
filter_pattern: Optional[string] = None,
page_token: Optional[string] = None,
) -> GetContainerLogResult
Returns the log events of a container of your Amazon Lightsail container service.
If your container service has more than one node (i.e., a scale greater than 1), then the log events that are returned for the specified container are merged from all nodes on your container service.
Container logs are retained for a certain amount of time. For more information, see Amazon Lightsail endpoints and quotas in the Amazon Web Services General Reference.
Parameters:
-
service_name(ContainerServiceName) –The name of the container service for which to get a container log.
-
container_name(string) –The name of the container that is either running or previously ran on the container service for which to return a log.
-
start_time(Optional[IsoDate], default:None) –The start of the time interval for which to get log data.
Constraints:
-
Specified in Coordinated Universal Time (UTC).
-
Specified in the Unix time format.
For example, if you wish to use a start time of October 1, 2018, at 8 PM UTC, specify
1538424000as the start time.
You can convert a human-friendly time to Unix time format using a converter like Epoch converter.
-
-
end_time(Optional[IsoDate], default:None) –The end of the time interval for which to get log data.
Constraints:
-
Specified in Coordinated Universal Time (UTC).
-
Specified in the Unix time format.
For example, if you wish to use an end time of October 1, 2018, at 9 PM UTC, specify
1538427600as the end time.
You can convert a human-friendly time to Unix time format using a converter like Epoch converter.
-
-
filter_pattern(Optional[string], default:None) –The pattern to use to filter the returned log events to a specific term.
The following are a few examples of filter patterns that you can specify:
-
To return all log events, specify a filter pattern of
"". -
To exclude log events that contain the
ERRORterm, and return all other log events, specify a filter pattern of"-ERROR". -
To return log events that contain the
ERRORterm, specify a filter pattern of"ERROR". -
To return log events that contain both the
ERRORandExceptionterms, specify a filter pattern of"ERROR Exception". -
To return log events that contain the
ERRORor theExceptionterm, specify a filter pattern of"?ERROR ?Exception".
-
-
page_token(Optional[string], default:None) –The token to advance to the next page of results from your request.
To get a page token, perform an initial
GetContainerLogrequest. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.
Raises:
-
AccessDeniedException–Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.
-
InvalidInputException–Lightsail throws this exception when user input does not conform to the validation rules of an input field.
Domain and distribution APIs are only available in the N. Virginia (
us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration tous-east-1to create, view, or edit these resources. -
NotFoundException–Lightsail throws this exception when it cannot find a resource.
-
RegionSetupInProgressException–Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.
-
ServiceException–A general service exception.
-
UnauthenticatedException–Lightsail throws this exception when the user has not been authenticated.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_lightsail/_services/async_lightsail.py
5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 | |