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: docs/references/ic-interface-spec/abstract-behavior.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4236,7 +4236,7 @@ S with
4236
4236
4237
4237
#### Canister out of cycles
4238
4238
4239
-
Once a canister runs out of cycles, its code is uninstalled (cf. [IC Management Canister: Code uninstallation](#rule-uninstall)), the canister changes in the canister history are dropped (their total number is preserved), and the allocations are set to zero:
4239
+
Once a canister runs out of cycles, its code is uninstalled (cf. [IC Management Canister: Code uninstallation](#rule-uninstall)), the canister changes in the canister history are dropped (their total number is preserved), and the allocations and the canister log memory limit are set to zero:
Copy file name to clipboardExpand all lines: docs/references/ic-interface-spec/management-canister.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -960,7 +960,7 @@ A snapshot may be deleted only by the controllers of the canister that the snaps
960
960
961
961
### IC method `fetch_canister_logs` {#ic-fetch_canister_logs}
962
962
963
-
This method can be called by canisters via replicated calls, i.e., it cannot be called by external users via replicated (update) calls.
963
+
This method can be called by canisters via replicated calls, but it cannot be called by external users via replicated (update) calls.
964
964
This method can also be called via non-replicated (query) calls: by external users directly and by canisters from composite query methods and their callbacks.
965
965
A call from a composite query is executed against the state of the subnet hosting the calling canister and can thus only target canisters hosted by that subnet.
966
966
@@ -982,7 +982,7 @@ A single log is a record with the following fields:
982
982
-`timestamp_nanos` (`nat64`): the timestamp as nanoseconds since 1970-01-01 at which the log was recorded;
983
983
-`content` (`blob`): the actual content of the log;
984
984
985
-
To filter canister logs, an optional filter can be provided and have one of the following variants:
985
+
To filter canister logs, an optional filter can be provided and has one of the following variants:
986
986
-`by_idx` (`record { start : nat64; end : nat64 }`): only logs are returned whose `idx` is within the provided range (`start` is inclusive, but `end` is exclusive);
987
987
-`by_timestamp_nanos` (`record { start : nat64; end : nat64 }`): only logs are returned whose `timestamp_nanos` is within the provided range (`start` is inclusive, but `end` is exclusive).
Copy file name to clipboardExpand all lines: docs/references/management-canister.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,7 @@ Several methods accept or return a `canister_settings` record. The fields are:
27
27
|`wasm_memory_limit`|`nat`|`0`| Upper limit on Wasm heap memory in bytes (0 = no limit) |
28
28
|`wasm_memory_threshold`|`nat`|`0`| Remaining Wasm memory threshold that triggers the low-memory hook |
29
29
|`log_visibility`|`log_visibility`|`controllers`| Who can read canister logs: `controllers`, `public`, or `allowed_viewers(vec principal)`|
30
+
|`log_memory_limit`|`nat`|`4096`| Memory in bytes for storing canister logs: either `0` or between `4096` and `2097152` (2 MiB) |
30
31
|`snapshot_visibility`|`snapshot_visibility`|`controllers`| Who can list and read canister snapshots: `controllers`, `public`, or `allowed_viewers(vec principal)`|
31
32
|`status_visibility`|`status_visibility`|`controllers`| Who can read the canister status: `controllers`, `public`, or `allowed_viewers(vec principal)`|
32
33
|`environment_variables`|`opt record`|`null`| Key-value pairs accessible during canister execution |
@@ -129,7 +130,7 @@ Returns detailed information about a canister: status, settings, module hash, cy
129
130
-`settings`: the definite canister settings currently in effect
130
131
-`module_hash` (`opt blob`): SHA-256 of installed module (`null` if empty)
@@ -534,13 +535,17 @@ For Bitcoin integration patterns, see the [Bitcoin guide](../guides/chain-fusion
534
535
535
536
### `fetch_canister_logs`
536
537
537
-
Returns the most recent log entries for a canister. Logs are produced by `ic0.debug_print` and trap messages. Logs persist across upgrades but are purged on reinstall or uninstall. Total log size is capped at 4 KiB.
538
+
Returns log entries for a canister. Logs are produced by `ic0.debug_print` and trap messages. Logs persist across upgrades but are purged on reinstall or uninstall. The oldest logs are purged once the memory used for canister logs exceeds the `log_memory_limit` canister setting.
538
539
539
-
-**Caller:** External users via query calls, or canisters from composite queries (not callable via replicated calls)
540
-
-**Parameters:**`canister_id` (`principal`)
540
+
-**Caller:** Canisters via replicated calls or composite queries, and external users via query calls (external users cannot call it via replicated calls)
541
+
-**Parameters:**
542
+
-`canister_id` (`principal`)
543
+
-`filter` (`opt variant { by_idx : record { start : nat64; end : nat64 }; by_timestamp_nanos : record { start : nat64; end : nat64 } }`): returns only the logs whose `idx` or `timestamp_nanos` falls in the given range (`start` is inclusive, `end` is exclusive)
The total size of the returned logs is bounded by an implementation-defined constant chosen so as not to exceed the maximum response size. When the selected logs do not all fit, an unfiltered read trims the oldest records, so the response ends with the newest log, and a filtered read trims the newest records, so the response starts with the oldest log matching the filter.
548
+
544
549
Log visibility is controlled by the `log_visibility` canister setting.
545
550
546
551
For practical usage, see the [canister logs guide](../guides/canister-management/logs.md).
0 commit comments