How do I enable debug logging and log rotation for the .NET Remote Connector Server (RCS)?
The purpose of this article is to provide information on enabling debug logging and log rotation for the .NET RCS in IDM. Enabling OpenICF logging is useful for troubleshooting issues and investigating .NET Connector Server crashes.
Overview
By default, logging is not enabled for the .NET RCS. Additionally, log files are not set to rotate by default, which means they will grow in size indefinitely when logging is enabled.
When you enable logging for the .NET RCS, it can also be useful to enable Microsoft® Windows® crash dumps as described here: Collecting User-Mode Dumps.
Debug Logging
In the ConnectorServer.exe.Config file (located in the directory where the .NET RCS is installed), you should make the following changes:
- In the appSettings section, change the value of the
add key="logging.proxy"
property to true: <add key="logging.proxy" value="true"/> - In the sharedListeners section, change the
initializeData
parameter forSystem.Diagnostics.EventTypeFilter
to Error: <filter type="System.Diagnostics.EventTypeFilter" initializeData="Error"/>You can set other logging levels using theinitializeData
parameter if required. The available levels are Error, Warning, Information (default), Verbose and All.
Verbose and All output very detailed logging; the level of logging has a direct effect on the performance of the .NET Connector Server so care should be taken when changing this setting.
Rotating Log Files
The instructions in this section require the Microsoft.VisualBasic.Logging assembly DLL; you should ensure this DLL exists on your .Net platform before proceeding.
- Edit the ConnectorServer.exe.Config file (located in the directory where the .NET RCS is installed) and replace the following default sharedListeners section:<sharedListeners> <add name="console" type="System.Diagnostics.ConsoleTraceListener"> </add> <add name="file" type="System.Diagnostics.TextWriterTraceListener" initializeData="logs\connectorserver.log" traceOutputOptions="DateTime"> <filter type="System.Diagnostics.EventTypeFilter" initializeData="Information"/> </add> </sharedListeners>With this section:<sharedListeners> <add name="console" type="System.Diagnostics.ConsoleTraceListener"/> <add name="file" type="Microsoft.VisualBasic.Logging.FileLogTraceListener,Microsoft.VisualBasic,Version=8.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" initializeData="FileLogWriter" traceOutputOptions="DateTime" Location="Custom" CustomLocation="/path/to/openicf/logs" BaseFileName="ConnectorServerService" LogFileCreationSchedule="Daily" MaxFileSize="50000000"> <filter type="System.Diagnostics.EventTypeFilter" initializeData="Error"/> </add> </sharedListeners>Where:
- The
CustomLocation
property allows you to set the location of the logs. - The
MaxFileSize
property specifies the maximum file size before the logs are rotated (this example rotates files once they reach 50 MB - 50000000 bytes).
See FileLogTraceListener Class for further information about these properties.
See Also
How do I enable database logging in IDM (All versions)?
Install a Remote Connector Server (RCS)
Related Training
N/A