How to Write the Custom Log to another Table

How to write the custom log to another table, while the default logs are also written to the dbo.logs table?

  1. Open the web.config file and find the following part
    2) Add the insert SQL for custom log after the default one in the tag <commandText>

    Note : Do not use the tables defined by UiPath to write the custom logs
<target xsi:type="BufferingWrapper" name="database" bufferSize="100" flushTimeout="5000" slidingTimeout="false">
  <target xsi:type="Database" connectionStringName="Default" keepConnection="true">
    <commandText>
     INSERT INTO dbo.Logs (OrganizationUnitId, TenantId, TimeStamp, Level, WindowsIdentity, ProcessName, JobKey, Message, RawMessage, RobotName, MachineId, UserKey)
     VALUES (@organizationUnitId, @tenantId, @timeStamp, @level, @windowsIdentity, @processName, @jobId, @message, @rawMessage, @robotName, @machineId, @userKey)
    (New insert SQL)
    </commandText>
    <parameter name="@organizationUnitId" layout="${event-properties:item=organizationUnitId}" />
    <parameter name="@tenantId" layout="${event-properties:item=tenantId}" />
    <parameter name="@timeStamp" layout="${date:format=yyyy-MM-dd HH\:mm\:ss.fff}" />
    <parameter name="@level" layout="${event-properties:item=levelOrdinal}" />
    <parameter name="@windowsIdentity" layout="${event-properties:item=windowsIdentity}" />
    <parameter name="@processName" layout="${event-properties:item=processName}" />
    <parameter name="@jobId" layout="${event-properties:item=jobId}" />
    <parameter name="@message" layout="${message}" />
    <parameter name="@rawMessage" layout="${event-properties:item=rawMessage}" />
    <parameter name="@robotName" layout="${event-properties:item=robotName}" />
    <parameter name="@machineId" layout="${event-properties:item=machineId}" />
    <parameter name="@userKey" layout="${event-properties:item=userKey}" />
  </target>
</target>