EQuIS Enterprise 6 - Install -…
  • RSS Feed

Last modified on 1/28/2014 4:15 PM by User.

EQuIS Enterprise 6 - Install - Log4net - AdoNetAppender

Keyword: Enterprise, configuring, advanced configuring, advanced configuration, .config

This page describes how to configure log4net (error logging) to store log information in ST_LOG for Enterprise 6.

  • EQuIS Enterprise 6 Web Logging: C:\Program Files\EarthSoft\EQuIS Enterprise\log4net.config

ST_LOG

Columns

  • LOG_ID - Unique identifier
  • LOG_DATE - Date the log was entered
  • LOG_THREAD - Thread number
  • LOG_LEVEL - Type of event e.g. (ERROR, DEBUG, etc)
  • LOGGER - The code file that raised the error
  • MESSAGE - The error message
  • LOG_TRACE - The debug stack trace

Log4net

Uncomment this section by removing the '<!--' from the beginning and '-->' from the end.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
<!--
<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
    <bufferSize value="1" />
    <connectionType value="System.Data.SqlClient.SqlConnection, System.Data.SqlClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <connectionString value="{ConnectionString}" />
    <commandText value="INSERT INTO st_log (log_date,log_thread,log_level,logger,message, log_trace) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)" />
    <parameter>
      <parameterName value="@log_date" />
      <dbType value="DateTime" />
      <layout type="log4net.Layout.PatternLayout" value="%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}" />
    </parameter>
    <parameter>
      <parameterName value="@thread" />
      <dbType value="String" />
      <size value="255" />
      <layout type="log4net.Layout.PatternLayout" value="%thread" />
    </parameter>
    <parameter>
      <parameterName value="@log_level" />
      <dbType value="String" />
      <size value="50" />
      <layout type="log4net.Layout.PatternLayout" value="%level" />
    </parameter>
    <parameter>
      <parameterName value="@logger" />
      <dbType value="String" />
      <size value="255" />
      <layout type="log4net.Layout.PatternLayout" value="%logger" />
    </parameter>
    <parameter>
      <parameterName value="@message" />
      <dbType value="String" />
      <size value="4000" />
      <layout type="log4net.Layout.PatternLayout" value="%message" />
    </parameter>
    <parameter>
      <parameterName value="@exception" />
      <dbType value="String" />
      <size value="4000" />
      <layout type="log4net.Layout.ExceptionLayout" />
    </parameter>
  </appender>
-->

Uncomment the line for 'AdoNetAppender' and comment out the line for 'RollingLogFileAppender'

1:
2:
3:
4:
5:
6:
<root>
    <level value="warn" />
    <appender-ref ref="RollingLogFileAppender" />
    <!--<appender-ref ref="ConsoleAppender"/>-->
    <!--<appender-ref ref="AdoNetAppender"/>-->
  </root>

like so:

1:
2:
3:
4:
5:
6:
<root>
    <level value="warn" />
    <!--<appender-ref ref="RollingLogFileAppender" />-->
    <!--<appender-ref ref="ConsoleAppender"/>-->
    <appender-ref ref="AdoNetAppender"/>
  </root>

For Oracle, follow the instruction above the AdoNetAppender to make it look like this:

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
    <bufferSize value="1" />
    <connectionType value="System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <connectionString value="{ConnectionString}" />
    <commandText value="INSERT INTO st_log (log_date,log_thread,log_level,logger,message, log_trace) VALUES (:log_date, :thread, :log_level, :logger, :message, :exception)" />
    <parameter>
      <parameterName value=":log_date" />
      <dbType value="DateTime" />
      <layout type="log4net.Layout.PatternLayout" value="%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}" />
    </parameter>
    <parameter>
      <parameterName value=":thread" />
      <dbType value="String" />
      <size value="255" />
      <layout type="log4net.Layout.PatternLayout" value="%thread" />
    </parameter>
    <parameter>
      <parameterName value=":log_level" />
      <dbType value="String" />
      <size value="50" />
      <layout type="log4net.Layout.PatternLayout" value="%level" />
    </parameter>
    <parameter>
      <parameterName value=":logger" />
      <dbType value="String" />
      <size value="255" />
      <layout type="log4net.Layout.PatternLayout" value="%logger" />
    </parameter>
    <parameter>
      <parameterName value=":message" />
      <dbType value="String" />
      <size value="4000" />
      <layout type="log4net.Layout.PatternLayout" value="%message" />
    </parameter>
    <parameter>
      <parameterName value=":exception" />
      <dbType value="String" />
      <size value="4000" />
      <layout type="log4net.Layout.ExceptionLayout" />
    </parameter>
  </appender>

 

Return to Top