System Log Extended Function
## Overview
The system log can be expanded by setting the parameter "[Rds.json](/en/manual/rds-json)". It is possible to record whether the request is from the API, the site ID of the request destination, the record ID, the HTTP status, etc.
## Notes
1. When running CodeDefiner, please take a backup of the database before running it. If the current number of records in the SysLogs table is large, it may take a long time to run CodeDefiner.
1. If you change the "SysLogsSchemaVersion" parameter "[Rds.json](/en/manual/rds-json)" to "2" and then change it back to "1", the additional column will be deleted. Be careful not to merge the parameter file incorrectly.
## Limitations
1. The status code "401" is recorded only when "LoginFailure" in "[SysLog.json](/en/manual/sys-log-json)" is true.
1. The status code "403" is recorded only when the recorded table and the time limited table are accessed. If an unauthorized user accesses a folder, it is recorded as "404".
## Prerequisites
1. To referance the "[System Log Management](/en/manual/syslog)" screen, "[Privileged User](/en/manual/user-management-privileged-users)" is required.
## Setting Procedure
1. Change "SysLogsSchemaVersion" in the parameter "[Rds.json](/en/manual/rds-json)" to "2".
1. Run CodeDefiner.
1. Verify that a log showing that the definition of the SysLogs table has been changed is output to the console.
1. Check the SysLogs table and verify that the column has been added.
#### CodeDefiner Execution Result
```bash:
> dotnet Implem.CodeDefiner.dll _rds
<INFO> UsersConfigurator.Execute: Implem.Pleasanter_Owner
<INFO> UsersConfigurator.Execute: Implem.Pleasanter_User
~Omitted~
<INFO> Tables.MigrateTable: SysLogs
<INFO> Tables.CreateTable: SysLogs
<INFO> Tables.MigrateTable: SysLogs
<INFO> Tables.CreateTable: SysLogs_deleted
<INFO> Tables.MigrateTable: SysLogs
<INFO> Tables.CreateTable: SysLogs_history
~Omitted~
<SUCCESS> Starter.ConfigureDatabase: Database configuration has been completed.
<SUCCESS> Starter.Main: All of the processes have been completed.
```
## Additional Columns
The columns added by extending the system log are as follows.
|Column name|e.g.|Description|
|:--|:--|:--|
|Api|1|If the request is from the API, "1" is recorded, otherwise "0" is recorded. |
|SiteId|9999|Record the "Site ID" of the reference. |
|ReferenceId| 9999|Record the "Site ID" if the reference is a table, or the "Record ID" if it is a record. |
|ReferenceType|Results|Records "Sites", "Issues", "Results", or "Wikis" according to the reference type. |
|Status|(described below)|Record the status code. |
|Description|(described below)|Record "Class name.method name:line Line number:Message displayed on screen" in the source code. |
## Status Code and Details
One of the following status codes is output.
|Status value|Description|Example of Description|
|:--|:--|:--|
|200|OK: When the request was processed successfully|(NULL)|
|400|Bad Request: General operation error|ResultValidators.OnUpdating:line 514:Record 99999 was locked by Administrator on 2023/07/07 12:00:00. |
|401|Unauthorized: When authentication failed|UserModel.LoginFailureLog:line 4403:The specified login ID or password is invalid. |
|403|Forbidden: When an unauthorized site is accessed|ResultValidators.OnCreating:line 216:The specified information was not found. |
|404|Not Found: When the web page cannot be found|ItemModel.Index:line 228:The specified information was not found. |
## Related Information
[Set Parameter: Rds.json](rds-json)
[System Log Management Function](syslog)