Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7926517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:48:23+00:00 2026-06-03T18:48:23+00:00

I have been attempting to get log4net logging any info or error into my

  • 0

I have been attempting to get log4net logging any info or error into my SQL Azure db in my asp.net web application with no success or any noticable errors. I am attempting to use the ADONetAppender appender with the following web.config:

<configuration>
  <configSections>
    <section name="log4net"
         type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"
         />
  </configSections>
  <log4net>
    <appSettings>
      <add key="log4net.Internal.Debug" value="true"/>
    </appSettings>
    <appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
      <bufferSize value="1" />
      <connectionType value="System.Data.SqlClient.SqlConnection, System.Data,
 Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <connectionString value="Server=;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True" />
      <commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message],[Exception]) 
 VALUES (@log_date, @thread, @log_level, @logger, @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="@log_level" />
        <dbType value="String" />
        <size value="50" />
        <layout type="log4net.Layout.PatternLayout">
          <conversionPattern value="%level" />
        </layout>
      </parameter>
      <parameter>
        <parameterName value="@logger" />
        <dbType value="String" />
        <size value="255" />
        <layout type="log4net.Layout.PatternLayout">
          <conversionPattern value="%logger" />
        </layout>
      </parameter>
      <parameter>
        <parameterName value="@message" />
        <dbType value="String" />
        <size value="4000" />
        <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>
    <root>
      <level value="DEBUG" />
      <appender-ref ref="ADONetAppender" />
    </root>
  </log4net>

….

In my global.asax Application_Start I call

 void Application_Start(object sender, EventArgs e)
            {
                // Code that runs on application startup
                log4net.Config.XmlConfigurator.Configure();


            }

Then to attempt to log:

 readonly ILog _logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

 protected void Button1_Click(object sender, EventArgs e)
    {
        if (_logger.IsInfoEnabled)
            _logger.Info("Performance sensitive Info message");
        _logger.Info("testing web role into Poqlogging");
        _logger.Error("new error",new Exception("new exception"));
    }

All of this does nothing as far as I can tell.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T18:48:24+00:00Added an answer on June 3, 2026 at 6:48 pm

    Based on the information you provided above several things could go wrong. To better understand the problem more Info needed.

    I can provide a few check points which you can verify:

    1. where do you run this application? In compute emulator or on Windows Azure
    2. IF it is running into Compute Emulator have your setup firewall at SQL Azure to accept connection from your development machine and vice-versa if required.
    3. If this application is running in Windows Azure, have you modified the firewall policy
    4. Where ever you run this application, you must be able to prove first that a connection to SQL Azure is possible because application itself can not do this, you would have to setup the environment so connection to SQL Azure is working
    5. With Log4Net I always do two things:
      1. I always verify first that my Log4Net setting/code does work file using the local logging
      2. Once above is confirmed, I jump to next step and add code/configuration to change logging to other destination.
    6. If all of above are verified, then look for network trace where your application is running (compute Emulator or Windows Azure) for any network data towards SQL Azure server.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been attempting to get log4net logging in my asp.net web application with
I have been attempting to get streaming working in Rails 3.2 on Heroku (see
I have been attempting to split a div into two columns using CSS, but
So I have been attempting to integrate captions and links into the Envato FlexSlider
i have been attempting to pass an object into a function that belongs to
I've been attempting to create a resizable textbox (ASP.NET multiline TextBox / HTML textarea
I have been attempting to get the MySQL Embedded Library working in my C#
I have been attempting to dive into RSpec 2 but its auto generated controller
I have been attempting this all morning (VS2K10, OL2K7, .NET 3.5) and my PSTs
I have been attempting to write some routines to read RSS and ATOM feeds

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.