Configuring Logging when the Connector is Installed Locally

Note: If the Connector is installed in a DXP cloud environment, see Configuring Logging in DXP Environments

In an environment where the Connector is installed locally, you can activate full verbose logging for it. This is useful for identifying errors.

To configure logging:

  1. Append the following to log4net.config:
<appender name="lionbridgeFileLogAppender" type="log4net.Appender.RollingFileAppender" >
      <!-- Consider moving the log files to a location outside the web application -->
      <file value="App_Data\LionbridgeErrors.log" />
      <encoding value="utf-8" /> <staticLogFileName value="true"/> <datePattern value=".yyyyMMdd.'log'" /> <rollingStyle value="Date" /> <threshold value="Verbose" />
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock"
/>
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
  <conversionPattern value="%date [%thread] %level %logger:
  %message%n" />
 </layout>
</appender>

  1. Add the following logger:
</logger>
<logger name="Lionbridge" additivity="false">
<level value="Verbose" />
<appender-ref ref="lionbridgeFileLogAppender" />
</logger>

The generated log file is:\App_Data\LionbridgeErrors.log.

  1. Add the logging setting for Log4Net into appsettings.json.

  2. Configure Logging for Log4Net: Add the AddLog4Net() call into your Configure method of the Program class.

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureCmsDefaults() .ConfigureLogging(builder => { builder.ClearProviders(); builder.AddLog4Net(); })
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});