User Manual

06.26.2025

MANUAL

Developer Function: Server Script: logs.LogException

## Overview The "LogException" method of the "[logs Object](/en/manual/server-script-logs)". It displays and outputs logs as type Exception in "[Server Script](/en/manual/table-management-server-script)". ## Syntax ``` logs.LogException(message, method, console, syslogs) ``` ## Parameters |Parameters|Type|Required|Description| |:----------|:----------|:---:|:---------------------------| |message|string|Yes|Specifies the error content to display and output.| |method|string||Optional. Default value is an empty string.| |console|bool||Optional. Default value is true. Set to true to display in the browser developer tools console.| |syslogs|bool||Optional. Default value is true. Set to true to output to the system log.| ## Return Value Returns true if the log is successfully displayed and output, otherwise returns false. ## Display Format in Console ##### Display Format ``` (Exception):[Method]Message ``` |Display Column|Display Content|Notes| |:----------|:-------|:-------| |Message|The string set in the message|| |Method|The string set in the method|Brackets ([]) are not displayed if the method is not specified.| ## Output Column in System Log |Destination column|Output content|Notes| |:----------|:-------|:-------| |ErrMessage|The string set in the message|| |Method|Combines the original method string with「:method」format|| |SysLogType|90|Fixed at 90(Exception)| ## Usage Example In the following example, a record with the title "About the Version Upgrade of Pleasanter" is created in a "temporary table" under Site ID 2. If an exception occurs, the log is output. ##### JavaScript ``` try { const siteId = 2; const item = items.NewIssue(); item.Title = 'About the Version Upgrade of Pleasanter'; const ret = items.Create(siteId, item); } catch(e) { // Exceptionログ logs.LogException(`Exception occurred\n ${e.stack}`); } ``` ## Supported Versions |Supported Versions|Body| |:--|:--| |1.4.12.0 or later|Added function| ## Related Information <div id="ManualList"><ul><li><a href="/en/manual/table-management-server-script">Table Management: Server Script</a><span>08.13.2024 up</span></li></ul></article> <ul><li><a href="/en/manual/server-script-logs">Developer Function: Server Script: logs</a><span>06.26.2025 up</span></li></ul></article></div><input id="SearchTextHidden" type="hidden" value="" />
TOP
このページをシェアする
記載された商品名、各製品名は各社の登録商標または商標です。 © Implem Inc.