doc-exports/docs/fg/umn/functiongraph_01_1834.html
Chen, Junjie dac566cf2f FG UMN 20230725 version
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com>
Co-authored-by: Chen, Junjie <chenjunjie@huawei.com>
Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
2024-04-03 10:30:56 +00:00

87 lines
11 KiB
HTML

<a name="functiongraph_01_1834"></a><a name="functiongraph_01_1834"></a>
<h1 class="topictitle1">Managing Function Logs</h1>
<div id="body32001227"><div class="section" id="functiongraph_01_1834__en-us_topic_0000001251924344_section15548615132812"><h4 class="sectiontitle">Using LTS to Manage Function Logs</h4><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p224519571172">You can enable LTS to better manage function logs. After you enable LTS, FunctionGraph automatically creates a log group starting with <strong id="functiongraph_01_1834__en-us_topic_0000001251924344_b58912310492">functiongraph</strong>. When you create a function, a log stream starting with the function name is generated.</p>
<div class="note" id="functiongraph_01_1834__en-us_topic_0000001251924344_note870551414445"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="functiongraph_01_1834__en-us_topic_0000001251924344_ul8307112915206"><li id="functiongraph_01_1834__en-us_topic_0000001251924344_li230772912200">By default, 20 log streams are created, which cannot be customized. On the <strong id="functiongraph_01_1834__en-us_topic_0000001251924344_b1774923623914">Logs</strong> tab page of the function, press <strong id="functiongraph_01_1834__en-us_topic_0000001251924344_b109721855173915">F12</strong> to find out the log stream ID of the <strong id="functiongraph_01_1834__en-us_topic_0000001251924344_b125212510414">query</strong> API, and then locate the corresponding log stream ID in LTS.<p id="functiongraph_01_1834__en-us_topic_0000001251924344_p19740423194119"><span><img id="functiongraph_01_1834__en-us_topic_0000001251924344_image874014232416" src="en-us_image_0000001258086894.png"></span></p>
</li><li id="functiongraph_01_1834__en-us_topic_0000001251924344_li1118113912100">Deleting a function log group by mistake on the LTS console will not be detected by FunctionGraph, and the historical log data can no longer be retrieved. To use a log group, modify the function description and save the changes. A new log group will be created.</li></ul>
</div></div>
<ol id="functiongraph_01_1834__en-us_topic_0000001251924344_ol991413224408"><li id="functiongraph_01_1834__en-us_topic_0000001251924344_li9913132219404"><span>Enable LTS.</span></li><li id="functiongraph_01_1834__en-us_topic_0000001251924344_li918844218272"><span>Set filter criteria.</span><p><ul id="functiongraph_01_1834__en-us_topic_0000001251924344_ul6627101021620"><li id="functiongraph_01_1834__en-us_topic_0000001251924344_li7996165822213"><strong id="functiongraph_01_1834__en-us_topic_0000001251924344_b1215311261422">Request List</strong>: Filter requests by request ID, result (success or failure), or cause (initialization failed, load failed, system error, timed out, out of memory, out of disk space, or code error). </li><li id="functiongraph_01_1834__en-us_topic_0000001251924344_li146276109164"><strong id="functiongraph_01_1834__en-us_topic_0000001251924344_b49844218320">Request Log</strong>: Filter logs by keyword, request ID, or instance ID.</li></ul>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="functiongraph_01_1834__en-us_topic_0000001251924344_table2080219411259" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Invocation result</caption><thead align="left"><tr id="functiongraph_01_1834__en-us_topic_0000001251924344_row1180017410253"><th align="left" class="cellrowborder" valign="top" width="16.03%" id="mcps1.3.1.4.2.2.2.2.3.1.1"><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p1079964122518">Result</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="83.97%" id="mcps1.3.1.4.2.2.2.2.3.1.2"><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p13799154122516">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="functiongraph_01_1834__en-us_topic_0000001251924344_row580014122516"><td class="cellrowborder" valign="top" width="16.03%" headers="mcps1.3.1.4.2.2.2.2.3.1.1 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p198009418251">Execution successful</p>
</td>
<td class="cellrowborder" valign="top" width="83.97%" headers="mcps1.3.1.4.2.2.2.2.3.1.2 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p17800144110252">Log printed when a function is successfully executed.</p>
</td>
</tr>
<tr id="functiongraph_01_1834__en-us_topic_0000001251924344_row1280064115252"><td class="cellrowborder" valign="top" width="16.03%" headers="mcps1.3.1.4.2.2.2.2.3.1.1 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p1680094116255">Execution failed</p>
</td>
<td class="cellrowborder" valign="top" width="83.97%" headers="mcps1.3.1.4.2.2.2.2.3.1.2 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p280024142513">Log printed when a function fails to be executed due to invocation timeout, memory or disk threshold exceeded, or code errors.</p>
<p id="functiongraph_01_1834__en-us_topic_0000001251924344_p4800204142515">To view the logs about invocation timeout, select <strong id="functiongraph_01_1834__en-us_topic_0000001251924344_b378845143720">Invocation timed out</strong> from the drop-down list. The methods for viewing the other three types of logs are the same.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="functiongraph_01_1834__en-us_topic_0000001251924344_table11191171620288" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Cause analysis</caption><thead align="left"><tr id="functiongraph_01_1834__en-us_topic_0000001251924344_row31920167281"><th align="left" class="cellrowborder" valign="top" width="15.770000000000001%" id="mcps1.3.1.4.2.2.3.2.3.1.1"><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p119220168287">Cause</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="84.23%" id="mcps1.3.1.4.2.2.3.2.3.1.2"><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p819351662812">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="functiongraph_01_1834__en-us_topic_0000001251924344_row31931816162819"><td class="cellrowborder" valign="top" width="15.770000000000001%" headers="mcps1.3.1.4.2.2.3.2.3.1.1 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p11412193010285">Initialization failed</p>
</td>
<td class="cellrowborder" valign="top" width="84.23%" headers="mcps1.3.1.4.2.2.3.2.3.1.2 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p84127305288">Log printed when the function initialization fails.</p>
</td>
</tr>
<tr id="functiongraph_01_1834__en-us_topic_0000001251924344_row1919361613287"><td class="cellrowborder" valign="top" width="15.770000000000001%" headers="mcps1.3.1.4.2.2.3.2.3.1.1 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p141315301284">Load failed</p>
</td>
<td class="cellrowborder" valign="top" width="84.23%" headers="mcps1.3.1.4.2.2.3.2.3.1.2 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p13413830192819">Log generated when the runtime fails to load your function file.</p>
</td>
</tr>
<tr id="functiongraph_01_1834__en-us_topic_0000001251924344_row919431610281"><td class="cellrowborder" valign="top" width="15.770000000000001%" headers="mcps1.3.1.4.2.2.3.2.3.1.1 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p1141333092815">System error</p>
</td>
<td class="cellrowborder" valign="top" width="84.23%" headers="mcps1.3.1.4.2.2.3.2.3.1.2 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p8413183012287">Internal error.</p>
</td>
</tr>
<tr id="functiongraph_01_1834__en-us_topic_0000001251924344_row10194161610281"><td class="cellrowborder" valign="top" width="15.770000000000001%" headers="mcps1.3.1.4.2.2.3.2.3.1.1 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p3413430142812">Invocation timed out</p>
</td>
<td class="cellrowborder" valign="top" width="84.23%" headers="mcps1.3.1.4.2.2.3.2.3.1.2 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p15413183022816">Log printed when the function invocation period is longer than the preset limit.</p>
</td>
</tr>
<tr id="functiongraph_01_1834__en-us_topic_0000001251924344_row171949163289"><td class="cellrowborder" valign="top" width="15.770000000000001%" headers="mcps1.3.1.4.2.2.3.2.3.1.1 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p20413153018288">Memory threshold exceeded</p>
</td>
<td class="cellrowborder" valign="top" width="84.23%" headers="mcps1.3.1.4.2.2.3.2.3.1.2 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p19413103042810">Log printed when the function memory size exceeds the preset limit.</p>
</td>
</tr>
<tr id="functiongraph_01_1834__en-us_topic_0000001251924344_row640221423116"><td class="cellrowborder" valign="top" width="15.770000000000001%" headers="mcps1.3.1.4.2.2.3.2.3.1.1 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p10404151413317">Disk threshold exceeded</p>
</td>
<td class="cellrowborder" valign="top" width="84.23%" headers="mcps1.3.1.4.2.2.3.2.3.1.2 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p18404181453119">Log printed when the disk size exceeds the preset limit.</p>
</td>
</tr>
<tr id="functiongraph_01_1834__en-us_topic_0000001251924344_row259121920316"><td class="cellrowborder" valign="top" width="15.770000000000001%" headers="mcps1.3.1.4.2.2.3.2.3.1.1 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p6591419123117">Code error</p>
</td>
<td class="cellrowborder" valign="top" width="84.23%" headers="mcps1.3.1.4.2.2.3.2.3.1.2 "><p id="functiongraph_01_1834__en-us_topic_0000001251924344_p459171917318">Log printed when a code error occurs.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="p" id="functiongraph_01_1834__en-us_topic_0000001251924344_p91845161165"><div class="note" id="functiongraph_01_1834__en-us_topic_0000001251924344_note519171313168"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="functiongraph_01_1834__en-us_topic_0000001251924344_ul9191613121612"><li id="functiongraph_01_1834__en-us_topic_0000001251924344_li0191513131619">You can view logs of the last hour, last day, last 3 days, or a custom time period.</li><li id="functiongraph_01_1834__en-us_topic_0000001251924344_li1719141331612">To manage function logs, go to the LTS console.</li><li id="functiongraph_01_1834__en-us_topic_0000001251924344_li47901526114319">Max. 10 MB logs can be retained for common instances during initialization. When this limit is reached, the latest logs replace the old ones.</li></ul>
</div></div>
</div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="functiongraph_01_1833.html">Logs</a></div>
</div>
</div>