doc-exports/docs/dws/dev/dws_04_0914.html
Lu, Huayi a24ca60074 DWS DEVELOPER 811 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2023-01-19 13:37:49 +00:00

36 lines
6.6 KiB
HTML

<a name="EN-US_TOPIC_0000001145694541"></a><a name="EN-US_TOPIC_0000001145694541"></a>
<h1 class="topictitle1">Logging Destination</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001145694541__s0dde7b8289d24a8e9b008afe4fb35391"><h4 class="sectiontitle">log_truncate_on_rotation</h4><p id="EN-US_TOPIC_0000001145694541__addb758e4e3e144fd8dd24540888dc8f5"><strong>Parameter description</strong>: Specifies the writing mode of the log files when <strong>logging_collector</strong> is set to <strong>on</strong>.</p>
<p id="EN-US_TOPIC_0000001145694541__p644741417593"><strong id="EN-US_TOPIC_0000001145694541__b75241730151719">Type</strong>: SIGHUP</p>
<p id="EN-US_TOPIC_0000001145694541__a8a9a4407c04a4267af434e22bf9ca5ce"><strong id="EN-US_TOPIC_0000001145694541__b17512856192313">Value range</strong>: Boolean</p>
<ul id="EN-US_TOPIC_0000001145694541__ubbc98b2864254c94b3ea4301a1d7deaa"><li id="EN-US_TOPIC_0000001145694541__lf90aa6649f6b4a16975ce986e34fc57a"><strong id="EN-US_TOPIC_0000001145694541__b84235270615159">on</strong> indicates that <span id="EN-US_TOPIC_0000001145694541__text320417202">GaussDB(DWS)</span> overwrites the existing log file of the same name on the server.</li><li id="EN-US_TOPIC_0000001145694541__l46e7ddca8bde485fbb0e22fc91cb24b5"><strong id="EN-US_TOPIC_0000001145694541__b37759311248">off</strong> indicates that <span id="EN-US_TOPIC_0000001145694541__text1271540357">GaussDB(DWS)</span> appends the log messages to the existing log file of the same name on the server.</li></ul>
<p id="EN-US_TOPIC_0000001145694541__aac64ef16a4e64f0ea07b861f304f4876"><strong id="EN-US_TOPIC_0000001145694541__b1471939182411">Default value</strong>: <strong id="EN-US_TOPIC_0000001145694541__b37191095247">off</strong></p>
<div class="note" id="EN-US_TOPIC_0000001145694541__note1450019511592"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001145694541__a88174745bfe2463b8cf10326f486989e">Example:</p>
<p id="EN-US_TOPIC_0000001145694541__a084c96e3ab104b6f969b35111f547814">Assume that you plan to keep logs in a period of 7 days, one log file is generated per day, log files generated on Monday are named <strong>server_log.Mon</strong> and named <strong>server_log.Tue</strong> on Tuesday (others are named in the same way), and log files generated on the same day in different weeks are overwritten. Implement the plan by performing the following operations: set <strong>log_filename</strong> to <strong>server_log.%a</strong>, <strong>log_truncate_on_rotation</strong> to <strong>on</strong>, and <strong>log_rotation_age</strong> to <strong>1440</strong> (indicating the valid duration of the log file is 24 hours).</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001145694541__s66a542971fb64daaa4568bac6837469f"><h4 class="sectiontitle">log_rotation_age</h4><p id="EN-US_TOPIC_0000001145694541__a917c058f4b4e4083ba3ff2b1e3ab6178"><strong>Parameter description</strong>: Specifies the interval for creating a log file when <strong>logging_collector</strong> is set to <strong>on</strong>. If the difference between the current time and the time when the previous audit log file is created is greater than the value of <strong>log_rotation_age</strong>, a new log file will be generated.</p>
<p id="EN-US_TOPIC_0000001145694541__p96612132014"><strong id="EN-US_TOPIC_0000001145694541__b829103201717">Type</strong>: SIGHUP</p>
<p id="EN-US_TOPIC_0000001145694541__a9e43813957c84d0fb10cfbbd819ed1f9"><strong id="EN-US_TOPIC_0000001145694541__en-us_topic_0059778787_en-us_topic_0058967679_b28247070">Value range</strong>: an integer ranging from 0 to 24 days. The unit is min, h, or d. <strong id="EN-US_TOPIC_0000001145694541__b14547571371">0</strong> indicates that the time-based creation of new log files is disabled.</p>
<p id="EN-US_TOPIC_0000001145694541__adc8dc862b0544b8c86c57ee611ce4978"><strong id="EN-US_TOPIC_0000001145694541__b4605672135217_4">Default value</strong>: <strong id="EN-US_TOPIC_0000001145694541__b842352706171854">1d</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001145694541__sbf2ea920c7554e3da55b3f6a1fd673ac"><h4 class="sectiontitle">log_rotation_size</h4><p id="EN-US_TOPIC_0000001145694541__a5d5a1dbad0324430add8ac310f5c42df"><strong>Parameter description</strong>: Specifies the maximum size of a server log file when <strong>logging_collector</strong> is set to <strong>on</strong>. If the total size of messages in a server log exceeds the capacity of the server log file, a log file will be generated.</p>
<p id="EN-US_TOPIC_0000001145694541__p14409230711"><strong id="EN-US_TOPIC_0000001145694541__b16135153321712">Type</strong>: SIGHUP</p>
<p id="EN-US_TOPIC_0000001145694541__a1d53f60ab1e04cb2b32da7c0395e8d64"><strong id="EN-US_TOPIC_0000001145694541__en-us_topic_0059778787_en-us_topic_0058967679_b44643227">Value range</strong>: an integer ranging from INT_MAX to 1024. The unit is KB.</p>
<p id="EN-US_TOPIC_0000001145694541__a7f71f65b729e465ea0d9d50d6f3349ff"><strong>0</strong> indicates the capacity-based creation of new log files is disabled.</p>
<p id="EN-US_TOPIC_0000001145694541__a534a02a4b21b4cf0bc3e2db1bbaffa8b"><strong id="EN-US_TOPIC_0000001145694541__b36363861152751">Default value</strong>: <strong id="EN-US_TOPIC_0000001145694541__b842352706171919">20 MB</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001145694541__se204ea3d196a4b8ebcdf96e51ce0cd6e"><h4 class="sectiontitle">event_source</h4><p id="EN-US_TOPIC_0000001145694541__aebd2afcc67bd41eeb79b37f6b1e3c6d0"><strong id="EN-US_TOPIC_0000001145694541__b46427230246">Parameter description</strong>: Specifies the identifier of the <span id="EN-US_TOPIC_0000001145694541__text505606557">GaussDB(DWS)</span> error messages in logs when <strong id="EN-US_TOPIC_0000001145694541__b764322315244">log_destination</strong> is set to <strong id="EN-US_TOPIC_0000001145694541__b36436236244">eventlog</strong>.</p>
<p id="EN-US_TOPIC_0000001145694541__p440031729"><strong id="EN-US_TOPIC_0000001145694541__b8373103481717">Type</strong>: POSTMASTER</p>
<p id="EN-US_TOPIC_0000001145694541__abacd8fc954ef4968b75ce372339d1866"><strong id="EN-US_TOPIC_0000001145694541__b1249310076">Value range</strong>: a string</p>
<p id="EN-US_TOPIC_0000001145694541__ad331dfb2beec4367b606c193b9851569"><strong id="EN-US_TOPIC_0000001145694541__b5155240211820_3">Default value</strong>: <strong id="EN-US_TOPIC_0000001145694541__b842352706171956">PostgreSQL</strong></p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0913.html">Error Reporting and Logging</a></div>
</div>
</div>