Log
Log
ServiceWatch logs allow you to monitor, store, and access log files collected from the resources of the services that provide logs.
| Log Group1 | Log Group1 | Log Group1 | Log Group2 | Log Group2 | Log Group2 |
|---|---|---|---|---|---|
| Log Stream1 | Log Stream2 | Log Stream3 | Log StreamA | Log StreamB | Log StreamC |
| Log Event | Log Event | Log Event | Log Event | Log Event | Log Event |
| Log Event | Log Event | Log Event | Log Event | Log Event | … |
As an example of the log configuration, it is as follows.
- 📂 Log group: “WebApp-Logs”
- 📄 log stream 1: “Server-1”
- 📝 Log Event 1: “[2025-03-20 10:00:01] User logged in”
- 📝 Log event 2: “[2025-03-20 10:05:34] Database connection error”
Log Group
A log group is a container for log streams that share the same retention policy settings, each log stream must belong to one log group, for example, if there are separate log streams for the logs of each Kubernetes Engine cluster, the log streams can be bundled into one log group named /scp/ske/{cluster name}.
Log Retention Policy
The log retention policy allows you to set the period during which log events are stored in ServiceWatch. Log events that have expired are automatically deleted. Log The retention period assigned to the group applies to the log streams and log events belonging to the log group.
The retention period can be selected from the following, and it is set in units of days.
| Preservation period |
|---|
|
Log Stream
A log stream is a collection of log events that are ordered by the time they occurred, from the same source, for example, all log events occurring in a specific Kubernetes Engine cluster can constitute one log stream.
Log Event
A log event is an individual record of a log that occurs from a resource. The log event record includes two properties: a timestamp of when the event occurred and a log message. Each message must be encoded in UTF-8.
Export log group
You can export log data from the log group to Object Storage for log archiving and log analysis, and you can also export log data within the same account to the log group.
To start logging group export, you must create an Object Storage bucket to store log data.
Exporting a log group can take a long time depending on the amount of log, when exporting a log group, you can specify a specific stream within the log group, or specify a time range to reduce the time it takes to export the log group.
Exporting a log group can only be executed once at a time for the same Account. To run another log group export, the current export task in progress must be completed.
| Log group export status | Description |
|---|---|
| Success | The log group export task was completed successfully. |
| Pending | Log group export task is pending. |
| In progress | The log group export task is in progress. |
| File transferring | Log group export file is being transferred. |
| Failed | The log group export task failed. |