The Systemite.SystemWeaver.TcpSubServer.exe does not need an .ini file since it gets its settings from the swDBServer executable. It does, however, need its own properties file for logging.


Prerequisites

  • A split server installation directory containing all required files to run the server.
  • A Systemite.SystemWeaver.TcpSubServer.exe.nlog located in the same directory as the server files.
  • Sufficient disk space must be available for storing the files.


Note: If running a mirror server, and you would like logging for that server as well, you will need to configure it for the mirror server locally on that server machine.


Systemite can provide an example file or simply copy the following content into a text editor.


Tip: The TcpSubServer logging is built on NLog. There are many NLog config options. Below is an example of dividing the TcpSubServer log file(s) into smaller volumes, i.e., a new log file each day, using shortdate.

Instead of:
fileName="D:/statistics/filename.log"

Use: 

fileName="D:/statistics/Statistics_${shortdate}.log"


(https://nlog-project.org/config/)


Systemite.SystemWeaver.TcpSubServer.exe.nlog

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
throwExceptions="false">

<variable name="appName" value="YourAppName" />

<targets async="true">
<target xsi:type="File"
name="default"
layout="${longdate} [${threadid}] - ${level:uppercase=true} ${message}${onexception:${newline}EXCEPTION\: ${exception:format=ToString}}"
fileName="D:\TcpSubServer.log"
keepFileOpen="false"
/>

<target xsi:type="EventLog"
name="eventlog"
source="${appName}"
layout="${message}${newline}${exception:format=ToString}"/>

<!--target name="statisticsLogFileAsync"
xsi:type="AsyncWrapper"
overflowAction="Grow"
queueLimit="10000"
batchSize="100"
timeToSleepBetweenBatches="50">
<target xsi:type="File"
name="statisticsLogFile"
fileName="C:\temp\Statistics.log">
<layout xsi:type="JsonLayout">
<attribute name="time" layout="${longdate}" />
<attribute name='seqId' layout='${event-properties:seqId}' />
<attribute name='sessionId' layout='${event-properties:sessionId}' />
<attribute name='ip' layout='${event-properties:ip}' />
<attribute name='userId' layout='${event-properties:userId}' />
<attribute name='userName' layout='${event-properties:userName}' />
<attribute name='email' layout='${event-properties:email}' />
<attribute name='appName' layout='${event-properties:appName}' />
<attribute name='event' encode='false'>
<layout type='JsonLayout' renderEmptyObject="false">
<attribute name='type' layout='${event-properties:eventType}' />
</layout>
</attribute>
<attribute name='call' encode='false'>
<layout type='JsonLayout' renderEmptyObject="false">
<attribute name='type' layout='${event-properties:callType}' />
</layout>
</attribute>
<attribute name='action' encode='false'>
<layout type='JsonLayout' renderEmptyObject="false">
<attribute name='type' layout='${event-properties:actionType}' />
</layout>
</attribute>
</layout>
</target>
</target-->
</targets>

<rules>
<logger name="*" writeTo="default" minlevel="Info" />
<logger name="*" writeTo="eventlog" minlevel="Error" />
<!--logger name="StatisticsLogger" minlevel="Info" writeTo="statisticsLogFileAsync" /-->
</rules>
</nlog>

Configuring the TcpSubServer Log

  1. Save the file as Systemite.SystemWeaver.TcpSubServer.exe.nlog.
  2. Open the file and update the fileName= line to indicate the TCPSubServer.log file name and the correct path to where you want the log to be placed. Naming it TCPSubServer.log will differentiate it from the swServer.log and ensure two separate log files should you have them generating in the same location.
  3. Save your changes.


Configuring a Statistics Log

The configuration file offers an optional, separate logging of certain user operations and usage statistics. To enable, uncomment the target name="statisticsLogFileAsync". 


Update the fileName= line in the target to indicate the desired file name and the correct path to where you want the log to be placed. The default filename is Statistics.Log, but you can change it to another that is unique in your target directory. The log is JSON formatted and can easily be read, analyzed and visualized using an external tool.


Note: We recommend that you do not make any changes to the settings in the top section of the target. 



Starting the Logging

Default Log

The Default logging will start automatically once you start and/or restart the main server. 


Statistics Log

The Statistic log will generate upon the first login to the server. 


For a brief explanation of the content of the log files, see Overview of Server Log Files.


Note: If the main server is running while you complete the configuration, it must be stopped and then restarted for the logging to begin successfully.