Skip to content

reportportal/logger-net-log4net

Repository files navigation

Build status

Installation

Install ReportPortal.Log4Net NuGet package.

NuGet version

PS> Install-Package ReportPortal.Log4Net

Configuration

Add custom appender into log4net configuration file.

<log4net>
  ...
  <appender name="RP" type="ReportPortal.Log4Net.ReportPortalAppender, ReportPortal.Log4Net">
    <layout type="log4net.Layout.SimpleLayout" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionpattern value="%message%newline" />
    </layout>
  </appender>
  ...
</log4net>

Specify reference to appender in the root section.

<log4net>
  ...
  <root>
      ...
      <appender-ref ref="RP" />
      ...
  </root>
  ...
</log4net>