You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/_includes/logging/read-logs.md
+50-45Lines changed: 50 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -6,70 +6,75 @@ You can filter records using the [language of filter expressions](../../logging/
6
6
7
7
- Management console
8
8
9
-
1. In the [management console]({{ link-console-main }}), go to the folder where the log group is located.
10
-
1. Open **{{ cloud-logging-name }}**.
11
-
1. Click the **Groups** tab.
12
-
1. Click on the line with the log group you want to view.
13
-
1. Click the **Logs** tab.
14
-
1. The page that opens will show the log group records.
9
+
1. In the [management console]({{ link-console-main }}), go to the folder where the log group is located.
10
+
1. Open **{{ cloud-logging-name }}**.
11
+
1. Click the **Groups** tab.
12
+
1. Click on the line with the log group you want to view.
13
+
1. Click the **Logs** tab.
14
+
1. The page that opens will show the log group records.
15
15
16
16
- CLI
17
17
18
-
{% include [cli-install](../cli-install.md) %}
18
+
{% include [cli-install](../cli-install.md) %}
19
19
20
-
{% include [default-catalogue](../default-catalogue.md) %}
20
+
{% include [default-catalogue](../default-catalogue.md) %}
21
21
22
-
When viewing the log, you can set a specific interval using the `--since` and `--until` flags. If no time interval is specified, information for the previous hour is displayed.
22
+
When viewing the log, you can set a specific interval using the `--since` and `--until` flags. If no time interval is specified, information for the previous hour is displayed.
23
23
24
-
The following flags are used:
25
-
26
-
*`--since`: Time N and later.
27
-
*`--until`: Time N and earlier.
24
+
The following flags are used:
28
25
29
-
If you only specify one flag, information is displayed for the hour before or after N depending on the flag.
If you only specify one flag, information is displayed for the hour before or after N depending on the flag.
35
30
36
-
To access a log group, use its name or unique ID. To find them, [get](../../logging/operations/list.md) a list of log groups in the folder. If you don't specify the name or ID, the records are output from the [default log group](../../logging/concepts/log-group.md) of the current folder.
31
+
Allowed time formats:
37
32
38
-
To view the records in JSON format, run the command:
To access a log group, use its name or unique ID. To find them, [get](../../logging/operations/list.md) a list of log groups in the folder. If you don't specify the name or ID, the records are output from the [default log group](../../logging/concepts/log-group.md) of the current folder.
43
37
44
-
Result:
38
+
To view the records in JSON format, run the command:
To read records as they appear, use the `--follow` flag:
44
+
Result:
64
45
65
-
```
66
-
yc logging read --group-name=default --follow
67
-
```
46
+
```
47
+
[
48
+
{
49
+
"uid": "488ece3c-75b8-4d35-95ac-2b491b123472",
50
+
"resource": {},
51
+
"timestamp": "2021-06-22T02:10:40Z",
52
+
"ingested_at": "2021-06-22T08:49:15.716Z",
53
+
"saved_at": "2021-06-22T08:49:16.176097Z",
54
+
"level": "INFO",
55
+
"message": "My message",
56
+
"json_payload": {
57
+
"request_id": "1234"
58
+
}
59
+
}
60
+
]
61
+
```
68
62
69
-
This command will return records for the last hour and continue to return new ones until you interrupt it with **Ctrl+C**. The `--follow` flag is not compatible with the `--since` and `--until` flags.
63
+
To read records as they appear, use the `--follow` flag:
64
+
65
+
```
66
+
yc logging read --group-name=default --follow
67
+
```
68
+
69
+
This command will return records for the last hour and continue to return new ones until you interrupt it with **Ctrl+C**. The `--follow` flag is not compatible with the `--since` and `--until` flags.
70
+
71
+
- API
72
+
73
+
You can view the entries in a log group using the API [read](../../logging/api-ref/grpc/log_reading_service.md) method.
70
74
71
75
- API
72
76
73
77
You can view the entries in a log group using the API [read](../../logging/api-ref/grpc/log_reading_service.md) method.
Copy file name to clipboardExpand all lines: en/_includes/logging/write-logs.md
+21-16Lines changed: 21 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -2,25 +2,30 @@
2
2
3
3
- CLI
4
4
5
-
{% include [cli-install](../cli-install.md) %}
5
+
{% include [cli-install](../cli-install.md) %}
6
6
7
-
{% include [default-catalogue](../default-catalogue.md) %}
7
+
{% include [default-catalogue](../default-catalogue.md) %}
8
8
9
-
To add records to a log group, run the command:
9
+
To add records to a log group, run the command:
10
10
11
-
```
12
-
yc logging write \
13
-
--group-name=default \
14
-
--message="My message" \
15
-
--timestamp="2021-06-08T19:10:40.000Z" \
16
-
--level=INFO \
17
-
--json-payload='{"request_id": "1234"}'
18
-
```
11
+
```
12
+
yc logging write \
13
+
--group-name=default \
14
+
--message="My message" \
15
+
--timestamp="2021-06-08T19:10:40.000Z" \
16
+
--level=INFO \
17
+
--json-payload='{"request_id": "1234"}'
18
+
```
19
19
20
-
*`--group-name`: Name of the log group to add records to. Optional parameter. If this parameter is omitted, records are added to the [default log group](../../logging/concepts/log-group.md) of the current folder.
21
-
*`--message`: Message.
22
-
*`--timestamp`: Time when the record is sent.
23
-
*`--level`: Logging level.
24
-
*`--json-payload`: Additional information in JSON format.
20
+
* `--group-name`: Name of the log group to add records to. Optional. If this parameter is omitted, records are added to the [default log group](../../logging/concepts/log-group.md) of the current folder.
21
+
* `--message`: Message.
22
+
* `--timestamp`: Time when the record is sent.
23
+
* `--level`: Logging level.
24
+
* `--json-payload`: Additional information in JSON format.
25
+
26
+
- API
27
+
28
+
You can add entries to a log group using the API [write](../../logging/api-ref/grpc/log_ingestion_service.md) method.
0 commit comments