forked from docs/doc-exports
Reviewed-by: Mützel, Andrea <andrea.muetzel@t-systems.com> Co-authored-by: liusiying01 <liusiying@huawei.com> Co-committed-by: liusiying01 <liusiying@huawei.com>
57 lines
9.5 KiB
HTML
57 lines
9.5 KiB
HTML
<a name="functiongraph_01_1841"></a><a name="functiongraph_01_1841"></a>
|
|
|
|
<h1 class="topictitle1">Configuring a Log Group and Log Stream</h1>
|
|
<div id="body8662426"><div class="section" id="functiongraph_01_1841__en-us_topic_0000001525506617_section8760134211306"><h4 class="sectiontitle">Introduction</h4><p id="functiongraph_01_1841__en-us_topic_0000001525506617_p1087211123816">You can bind a log group and log stream to a function to store its invocation logs. By default, the logs are stored in the log stream automatically created for the function. For details, see <a href="functiongraph_01_1834.html#functiongraph_01_1834__en-us_topic_0000001251924344_section15548615132812">Using LTS to Manage Function Logs</a>.</p>
|
|
</div>
|
|
<div class="section" id="functiongraph_01_1841__en-us_topic_0000001525506617_section197112582305"><h4 class="sectiontitle">Prerequisites</h4><p id="functiongraph_01_1841__en-us_topic_0000001525506617_p475215364183">You have created a log group and log stream on the LTS console.</p>
|
|
</div>
|
|
<div class="section" id="functiongraph_01_1841__en-us_topic_0000001525506617_section338271419316"><h4 class="sectiontitle">Procedure</h4><ol id="functiongraph_01_1841__en-us_topic_0000001525506617_ol9811413615"><li id="functiongraph_01_1841__en-us_topic_0000001525506617_li1492244763210">Log in to the FunctionGraph console. In the navigation pane, choose <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_en-us_topic_0000001251907924_b033610517502">Functions</strong> > <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_en-us_topic_0000001251907924_b183361950502">Function List</strong>.</li><li id="functiongraph_01_1841__en-us_topic_0000001525506617_li16939810113319">Click the function to be configured to go to the function details page.</li><li id="functiongraph_01_1841__en-us_topic_0000001525506617_li371511346209">Choose <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b1375182771">Configuration</strong> > <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b55171841716">Log</strong>, and configure log collection according to <a href="#functiongraph_01_1841__en-us_topic_0000001525506617_table71231511153518">Table 1</a>.
|
|
<div class="tablenoborder"><a name="functiongraph_01_1841__en-us_topic_0000001525506617_table71231511153518"></a><a name="en-us_topic_0000001525506617_table71231511153518"></a><table cellpadding="4" cellspacing="0" summary="" id="functiongraph_01_1841__en-us_topic_0000001525506617_table71231511153518" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Log configuration parameters</caption><thead align="left"><tr id="functiongraph_01_1841__en-us_topic_0000001525506617_row3124211173513"><th align="left" class="cellrowborder" valign="top" width="30.59%" id="mcps1.3.3.2.3.4.2.3.1.1"><p id="functiongraph_01_1841__en-us_topic_0000001525506617_p112411119351">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="69.41000000000001%" id="mcps1.3.3.2.3.4.2.3.1.2"><p id="functiongraph_01_1841__en-us_topic_0000001525506617_p4124161110356">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="functiongraph_01_1841__en-us_topic_0000001525506617_row191241611183516"><td class="cellrowborder" valign="top" width="30.59%" headers="mcps1.3.3.2.3.4.2.3.1.1 "><p id="functiongraph_01_1841__en-us_topic_0000001525506617_p812431115351">Collect Logs</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="69.41000000000001%" headers="mcps1.3.3.2.3.4.2.3.1.2 "><p id="functiongraph_01_1841__en-us_topic_0000001525506617_p1112412112350">Enabled by default in FunctionGraph V2. This feature is unavailable for FunctionGraph V1.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1841__en-us_topic_0000001525506617_row11124171113510"><td class="cellrowborder" valign="top" width="30.59%" headers="mcps1.3.3.2.3.4.2.3.1.1 "><p id="functiongraph_01_1841__en-us_topic_0000001525506617_p1112431123519">Log Group</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="69.41000000000001%" headers="mcps1.3.3.2.3.4.2.3.1.2 "><p id="functiongraph_01_1841__en-us_topic_0000001525506617_p2098127112915">Select a log group for the function. The default log group <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b4455883319">functiongraph.log.group.</strong><em id="functiongraph_01_1841__en-us_topic_0000001525506617_i205012001345">xxx</em> cannot be selected.</p>
|
|
<p id="functiongraph_01_1841__en-us_topic_0000001525506617_p631819593166">By default, the log group (starting with <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b1134316397549">functiongraph</strong>) automatically generated by FunctionGraph is selected.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1841__en-us_topic_0000001525506617_row7124191116359"><td class="cellrowborder" valign="top" width="30.59%" headers="mcps1.3.3.2.3.4.2.3.1.1 "><p id="functiongraph_01_1841__en-us_topic_0000001525506617_p191248117355">Log Stream</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="69.41000000000001%" headers="mcps1.3.3.2.3.4.2.3.1.2 "><p id="functiongraph_01_1841__en-us_topic_0000001525506617_p0486134654719">Select a log stream in the specified log group.</p>
|
|
<p id="functiongraph_01_1841__en-us_topic_0000001525506617_p9340722202111">By default, the log stream (starting with the function name) automatically generated for the function is selected.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="functiongraph_01_1841__en-us_topic_0000001525506617_li3799161520619">Click <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b199441442121018">Save</strong>.</li><li id="functiongraph_01_1841__en-us_topic_0000001525506617_li1641634418618">After the function is invoked, <a href="#functiongraph_01_1841__en-us_topic_0000001525506617_section68074783519">view logs</a> in the specified log group and log stream.<div class="note" id="functiongraph_01_1841__en-us_topic_0000001525506617_note8604145424011"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="functiongraph_01_1841__en-us_topic_0000001525506617_p860595494011">You can change the log stream if needed.</p>
|
|
</div></div>
|
|
</li></ol>
|
|
</div>
|
|
<div class="section" id="functiongraph_01_1841__en-us_topic_0000001525506617_section68074783519"><a name="functiongraph_01_1841__en-us_topic_0000001525506617_section68074783519"></a><a name="en-us_topic_0000001525506617_section68074783519"></a><h4 class="sectiontitle">Viewing Function Logs</h4><p id="functiongraph_01_1841__en-us_topic_0000001525506617_p1280114743512">View function logs in the specified log group and log stream.</p>
|
|
<ol id="functiongraph_01_1841__en-us_topic_0000001525506617_ol48064713516"><li id="functiongraph_01_1841__en-us_topic_0000001525506617_li43131042155819">Return to the FunctionGraph console. In the navigation pane, choose <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b207798097091518">Functions</strong> > <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b124979086091518">Function List</strong>.</li><li id="functiongraph_01_1841__en-us_topic_0000001525506617_li7819477357">Click the function to be configured to go to the function details page.</li><li id="functiongraph_01_1841__en-us_topic_0000001525506617_li181247203512">Choose <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b1698323114569">Monitoring</strong> > <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b0983431185618">Logs</strong> and view the function logs.<ul id="functiongraph_01_1841__en-us_topic_0000001525506617_ul138144712354"><li id="functiongraph_01_1841__en-us_topic_0000001525506617_li19811147123514">As shown in <a href="#functiongraph_01_1841__en-us_topic_0000001525506617_fig3273153215525">Figure 1</a>, logs of the function are generated in the specified log group and log stream.</li><li id="functiongraph_01_1841__en-us_topic_0000001525506617_li18164710359">If no custom log group and log stream are specified, the default log group (starting with <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b19874194815564">functiongraph</strong>) and log stream are displayed.<div class="fignone" id="functiongraph_01_1841__en-us_topic_0000001525506617_fig3273153215525"><a name="functiongraph_01_1841__en-us_topic_0000001525506617_fig3273153215525"></a><a name="en-us_topic_0000001525506617_fig3273153215525"></a><span class="figcap"><b>Figure 1 </b>Viewing function logs</span><br><span><img id="functiongraph_01_1841__en-us_topic_0000001525506617_image12749328524" src="en-us_image_0000001679118141.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
</li><li id="functiongraph_01_1841__en-us_topic_0000001525506617_li1886732412585">On the <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b11948113215520">Request List</strong> tab, you can query the time consumed by each request ID, used memory, and version. You can check whether the request is cold started based on the <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b124862536572">Cause</strong> column. If <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b031011515819">Common cold start successful</strong> is displayed, the request is cold started. If <strong id="functiongraph_01_1841__en-us_topic_0000001525506617_b697155815813">Execution successful</strong> is displayed, the request is not cold started.</li></ul>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="functiongraph_01_0300.html">Configuring Functions</a></div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script language="JavaScript">
|
|
<!--
|
|
image_size('.imgResize');
|
|
var msg_imageMax = "view original image";
|
|
var msg_imageClose = "close";
|
|
//--></script> |