0

I'm trying to use log4net appender and log into snowflake table. But it's not working. Not sure what the connectiontype should be. Below the code I have tried.

<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
      <bufferSize value="1" />
      <reconnectonerror value="true" />
      <connectionString value="scheme=https;ACCOUNT=<account>;HOST=<host>;port=<port>; ROLE=<role>;WAREHOUSE=<warehouse>; USER=<user>; PASSWORD=<password>;DB=<db>;SCHEMA=<schema>"/>
      <commandText value="Insert into log_messages (log_date, log_thread, log_level, log_logger, log_class, log_method, log_username, log_message, log_exception, log_stacktrace, log_stacktracedetail, appfree1, appfree2, appfree3) values (@log_date, @thread, @log_level, 'logger', @class, @method, @username, @message, @exception, @stacktrace, @stacktracedetail, @appfree1, @appfree2, @appfree3) " />
      <parameter>
        <parameterName value="@log_date" />
        <dbType value="DateTime" />
        <layout type="log4net.Layout.PatternLayout" value="%date{yyyy-MM-ddTHH:mm:ss.fff}" />
      </parameter>
      <parameter>
        <parameterName value="@thread" />
        <dbType value="String" />
        <size value="255" />
        <layout type="log4net.Layout.PatternLayout">
          <conversionPattern value="%thread" />
        </layout>
      </parameter>
      .
      .
    </appender>

How can I log into the table in snowflake ? Is there any other way to do this

spookky
  • 31
  • 3
  • What exactly are you trying to do? You've created a table in Snowflake and you're trying to insert into this table the log lines coming out of .NET connector? – Sergiu Mar 14 '23 at 08:34
  • yes. I'm trying to insert the log into the snowflake table instead of writing on to a file. – spookky Mar 14 '23 at 12:42
  • What about the log4net configuration? This [post](https://stackoverflow.com/questions/10834884/log4net-with-adonetappender-nothing-happens) might be useful for your case. – Sergiu Mar 14 '23 at 13:00
  • I tried this but snowflake doesn't have "connectiontype". Tried with "connectionstring" alone but it's not working. – spookky Mar 14 '23 at 15:38

0 Answers0