Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
CREATE TABLE dbo.RequestResponseContentLog (
    Id int IDENTITY (1, 1) NOT NULL,
    Date datetime NOT NULL,
	Thread varchar(255) NOT NULL,
	CorrelationId varchar(255) NOT NULL,
    ApiClientId varchar(255) NULL,
    Level varchar(50) NULL,
	RequestUrl varchar(255) NULL,
	RequestMethod varchar(10) NULL,
	ProfilesHeader varchar(255) NULL,
	RequestBody nvarchar(max) NULL,
	ResponseBody nvarchar(max) NULL,
    ResponseMessage varchar(255) NULL,
    Exception varchar(2000) NULL
)

...

Code Block
languagesql
CREATE TABLE edfi.RequestResponseContentLog (
Id SERIAL PRIMARY KEY NOT NULL,
Date TIMESTAMP NOT NULL,
Thread varchar (255) NOT NULL,
CorrelationId varchar (255) NOT NULL,
ApiClientId varchar (255) NULL,
Level varchar (50) NULL,
RequestUrl varchar (255) NULL,
RequestMethod varchar (10) NULL,
ProfilesHeader varchar (255) NULL,
RequestBody varchar NULL,
ResponseBody varchar NULL,
ResponseMessage varchar (255) NULL,
Exception varchar (2000) NULL
)

...

Code Block
languagexml
  <logger name="RequestResponseContentLogger" additivity="false">
	<level value="ERROR" />
	<appender-ref ref="RequestResponseContentAppender" />
  </logger>
  <appender name="RequestResponseContentAppender" type="log4net.Appender.AdoNetAppender">
    <bufferSize value="0" />
    <threshold value="ERROR" />
    <connectionType value="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" />
    <commandText value="INSERT INTO RequestResponseContentLog ([Date],[Thread],[CorrelationId],[ApiClientId],[Level],[RequestUrl],[RequestMethod],[ProfilesHeader],[RequestBody],[ResponseBody],[ResponseMessage],[Exception]) VALUES (@log_date, @thread, @correlation_id, @api_client_id, @log_level, @request_url, @request_method, @profiles_header, @request_body, @response_body, @response_message, @exception)" />
    <parameter>
        <parameterName value="@log_date" />
        <dbType value="DateTime" />
        <layout type="log4net.Layout.RawTimeStampLayout" />
    </parameter>
    <parameter>
        <parameterName value="@thread" />
        <dbType value="String" />
        <size value="255" />
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%thread" />
        </layout>
    </parameter>
    <parameter>
    	    <parameterName value="@api_client@correlation_id" />
  	      <dbType value="String" />
    	    <size value="255" />
	        <layout type="log4net.Layout.PatternLayout">
		    <conversionPattern         <conversionPattern value="%property{ApiClientIdCorrelationId}" />
    	    </layout>
    </parameter>
    <parameter>
    	    <parameterName value="@log@api_client_levelid" />
    	    <dbType value="String" />
    	    <size value="50255" />
    	    <layout type="log4net.Layout.PatternLayout">
		            <conversionPattern value="%level%property{ApiClientId}" />
	        <</layout>
    </parameter>
    <parameter>
    	    <parameterName value="@request@log_urllevel" />
  	      <dbType value="String" />
    	    <size value="25550" />
  	      <layout type="log4net.Layout.PatternLayout">
		
            <conversionPattern value="%property{RequestUrlWithQueryString}%level" />
 	       </layout>
    </parameter>
    <parameter>
	    <parameterName value="@request_methodurl" />
	    <dbType value="String" />
	    <size value="10255" />
	    <layout type="log4net.Layout.PatternLayout">
		    <conversionPattern value="%property{RequestMethodRequestUrlWithQueryString}" />
	    </layout>
    </parameter>
    <parameter>
	    <parameterName value="@profiles@request_headermethod" />
	    <dbType value="String" />
	    <size value="25510" />
	    <layout type="log4net.Layout.PatternLayout">
		    <conversionPattern value="%property{ProfilesHeaderRequestMethod}" />
	    </layout>
    </parameter>
    <parameter>
    	    <parameterName value="@request@profiles_bodyheader" />
   	     <dbType value="String" />
    	    <size value="-1255" />
  	      <layout type="log4net.Layout.PatternLayout">
        		    <conversionPattern value="%property{RequestBodyProfilesHeader}" />
    	    </layout>
    </parameter>
    <parameter>
	        <parameterName value="@response@request_body" />
 	       <dbType value="String" />
	     <size value  <size value="-1" />
    	    <layout type="log4net.Layout.PatternLayout">
		
            <conversionPattern value="%property{ResponseBodyRequestBody}" />
 	       </layout>
    </parameter>
    <parameter>
    	    <parameterName value="@response_messagebody" />
    	    <dbType value="String" />
    	    <size value="255-1" />
    	    <layout type="log4net.Layout.PatternLayout">
		            <conversionPattern value="%message%property{ResponseBody}" />
    	    </layout>
    </parameter>
    <parameter>
        <parameterName value="@exception@response_message" />
        <dbType value="String" />
        <size value="2000255" />
        <layout type="log4net.Layout.ExceptionLayoutPatternLayout" />
    </parameter>   </appender>

Using PostgreSQL

Code Block
languagexml
  <logger name="RequestResponseContentLogger" additivity="false">
	<level <conversionPattern value="ERROR%message" />
	<appender-ref ref="RequestResponseContentAppender" />       </layout>
    </logger>parameter>
    <parameter>
 <appender name="RequestResponseContentAppender" type="log4net.Appender.AdoNetAppender">     <bufferSize<parameterName value="0@exception" />
        <threshold<dbType value="ERRORString" />
     <connectionType   <size value="Npgsql.NpgsqlConnection, Npgsql2000" />
    <commandText value="INSERT INTO edfi.RequestResponseContentLog (date,thread,apiclientid,level,requesturl,requestmethod,profilesheader,requestbody,responsebody,responsemessage,exception) VALUES (@log_date, @thread, @api_client_id, @log_level, @request_url, @request_method, @profiles_header, @request_body, @response_body, @response_message, @exception)    <layout type="log4net.Layout.ExceptionLayout" />
    </parameter>
  </appender>

Using PostgreSQL

Code Block
languagexml
  <logger name="RequestResponseContentLogger" additivity="false">
	<level value="ERROR" />
	<appender-ref ref="RequestResponseContentAppender" />
  </logger>
  <appender name="RequestResponseContentAppender" type="log4net.Appender.AdoNetAppender">
    <bufferSize value="0" />
    <threshold value="ERROR" />
     <connectionType value="Npgsql.NpgsqlConnection, Npgsql" />
    <commandText value="INSERT INTO edfi.RequestResponseContentLog (date,thread,correlationid,apiclientid,level,requesturl,requestmethod,profilesheader,requestbody,responsebody,responsemessage,exception) VALUES (@log_date, @thread, @correlation_id, @api_client_id, @log_level, @request_url, @request_method, @profiles_header, @request_body, @response_body, @response_message, @exception)" />
    <parameter>
        <parameterName value="@log_date" />
        <dbType value="DateTime" />
        <layout type="log4net.Layout.RawTimeStampLayout" />
    </parameter>
    <parameter>
        <parameterName value="@thread" />
    <parameter>         <parameterName<dbType value="@log_dateString" />
        <dbType<size value="DateTime255" />
        <layout type="log4net.Layout.RawTimeStampLayoutPatternLayout">
            <conversionPattern value="%thread" />
        </layout>
    </parameter>
    <parameter>
        <parameterName value="@thread@correlation_id" />
        <dbType value="String" />
        <size value="255" />
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%thread%property{CorrelationId}" />
        </layout>
    </parameter>
    <parameter>
	    <parameterName value="@api_client_id" />
	    <dbType value="String" />
	    <size value="255" />
	    <layout type="log4net.Layout.PatternLayout">
		    <conversionPattern value="%property{ApiClientId}" />
	    </layout>
    </parameter>
    <parameter>
        <parameterName value="@log_level" />
        <dbType value="String" />
        <size value="50" />
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%level" />
        </layout>
    </parameter>
    <parameter>
	    <parameterName value="@request_url" />
	    <dbType value="String" />
	    <size value="255" />
	    <layout type="log4net.Layout.PatternLayout">
		    <conversionPattern value="%property{RequestUrlWithQueryString}" />
	    </layout>
    </parameter>
    <parameter>
	    <parameterName value="@request_method" />
	    <dbType value="String" />
	    <size value="10" />
	    <layout type="log4net.Layout.PatternLayout">
		    <conversionPattern value="%property{RequestMethod}" />
	    </layout>
    </parameter>
    <parameter>
	    <parameterName value="@profiles_header" />
	    <dbType value="String" />
	    <size value="255" />
	    <layout type="log4net.Layout.PatternLayout">
		    <conversionPattern value="%property{ProfilesHeader}" />
	    </layout>
    </parameter>
    <parameter>
        <parameterName value="@request_body" />
        <dbType value="String" />
        <size value="-1" />
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%property{RequestBody}" />
        </layout>
    </parameter>
    <parameter>
	    <parameterName value="@response_body" />
	    <dbType value="String" />
	    <size value="-1" />
	    <layout type="log4net.Layout.PatternLayout">
		    <conversionPattern value="%property{ResponseBody}" />
	    </layout>
    </parameter>
    <parameter>
        <parameterName value="@response_message" />
        <dbType value="String" />
        <size value="255" />
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%message" />
        </layout>
    </parameter>
    <parameter>
        <parameterName value="@exception" />
        <dbType value="String" />
        <size value="2000" />
        <layout type="log4net.Layout.ExceptionLayout" />
    </parameter>
  </appender>

...