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

  • Home
  • SEARCH
  • 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 9267171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:29:20+00:00 2026-06-18T14:29:20+00:00

I have a strange situation: I have configured custom log4net Appender to write to

  • 0

I have a strange situation:

I have configured custom log4net Appender to write to Azure Table storage. I have WorkerRole and WebRole. Both roles use osFamily=”3″ (Windows Server 2012), I use .NET 4.5 in both and use ASP.NET MVC4 for the WebRole. Everything is configured and works fine locally – both the worker and the web role are logging correctly. However, when I deploy to Azure, only Worker role logs successfully, webrole does not produce any logs (any!), while it should.

I have configured log4net on the WebRole to debug and emit log4net debugging data into the Trace to check for some issues, but it sends no errors/warnings. Nor it sends logging messages.

Here is the log produced by log4net debugging (stripped sensitive data):

log4net: log4net assembly [log4net, Version=1.2.11.0, Culture=neutral,
PublicKeyToken=669e0ddf0bb1aa2a]. Loaded from
[D:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET
Files\root\59a01799\5b6b1a2\assembly\dl3\8d97587f\b9d49402_c202ce01\log4net.dll].
(.NET Runtime [4.0.30319.18010] on Microsoft Windows NT 6.2.9200.0)
log4net: defaultRepositoryType
[log4net.Repository.Hierarchy.Hierarchy] log4net: Creating repository
for assembly [_my_referenced_assembly_, Version=1.3.0.20282,
Culture=neutral, PublicKeyToken=null] log4net: Assembly
[_my_referenced_assembly_, Version=1.3.0.20282, Culture=neutral,
PublicKeyToken=null] Loaded From
[D:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET
Files\root\59a01799\5b6b1a2\assembly\dl3\8cc98c20\594c5b41_6f07ce01_my_referenced_assembly_.dll]
log4net: Assembly [_my_referenced_assembly_, Version=1.3.0.20282,
Culture=neutral, PublicKeyToken=null] does not have a
RepositoryAttribute specified. log4net: Assembly
[_my_referenced_assembly_, Version=1.3.0.20282, Culture=neutral,
PublicKeyToken=null] using repository [log4net-default-repository] and
repository type [log4net.Repository.Hierarchy.Hierarchy] log4net:
Creating repository [log4net-default-repository] using type
[log4net.Repository.Hierarchy.Hierarchy] Loaded
“Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35” Getting
“_some_setting_1_” from ServiceRuntime: PASS (_my_value1_). Getting
“_some_setting_2_” from ServiceRuntime: PASS (_my_value2_). Getting
“_some_setting_3_” from ServiceRuntime: PASS (_my_value3_). Getting
“Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString” from
ServiceRuntime: PASS (_my_conn_string_). Getting “_some_setting_4_”
from ServiceRuntime: PASS (_my_value4_). log4net: Creating repository
for assembly [_my_WEB_assembly_, Version=1.3.0.20283, Culture=neutral,
PublicKeyToken=null] log4net: Assembly [_my_WEB_assembly_,
Version=1.3.0.20283, Culture=neutral, PublicKeyToken=null] Loaded From
[D:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET
Files\root\59a01799\5b6b1a2\assembly\dl3\f695181f\98c73242_6f07ce01_my_WEB_assembly_.dll]
log4net: Assembly [_my_WEB_assembly_, Version=1.3.0.20283,
Culture=neutral, PublicKeyToken=null] does not have a
RepositoryAttribute specified. log4net: Assembly [_my_WEB_assembly_,
Version=1.3.0.20283, Culture=neutral, PublicKeyToken=null] using
repository [log4net-default-repository] and repository type
[log4net.Repository.Hierarchy.Hierarchy] log4net: repository
[log4net-default-repository] already exists, using repository type
[log4net.Repository.Hierarchy.Hierarchy] Getting “acs:idps” from
ServiceRuntime: FAIL. Getting “acs:idps” from ConfigurationManager:
PASS ([my_value]).

Here is sample of both my app.config (for worker) and web.config (for web role) files (I also set this into WaIISHost.config just in case, but the result is still the same – totally muted WebRole):

<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
    ...
  </configSections>
 ...
  <log4net>
    <appender name="AzureTableStoreAppender" type="_MyAssembly_.Logging.AzureTableStorageAppender, MyAssembly">
    </appender>
    <root>
      <level value="ALL" />
      <appender-ref ref="AzureTableStoreAppender" />
    </root>
  </log4net>
</configuration>

I configure log4net via the assembly level attribute. Thus in Worker role assembly I have:

[assembly: log4net.Config.XmlConfigurator(Watch = true)]

And in web role I have:

[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Web.config", Watch = true)]

As I said, everything works fine and writes table entities fine when run locally. My Local Environemtn is Windows 8 Pro, running the web roles in IIS Server (not IIS Express), which is IIS8. I also tried marking the WebRole executionContext to elevated but still nothing happens. It is like a black hole for log4net.

My custom appender is defined in a separate Assembly, .net Framework 4.5 (full), of type Class Library which is referenced in both Web and Worker projects. As already said – locally everything works fine. The assembly that defines my custom appender is definitely loaded, because it also contains business logic of my web app, which works deployed in Azure as well.

UPDATE

Interesting discovery. When I use Debug build configuration everything works everywhere (azure web role also). But when I use Release configuration (which is default for packaging and production code) I can’t seem to be able to make log4net working anywhere. Meaning that I can’t make Log4Net running even locally with Release config. No exceptions are being raised, no errors being logged. As strange as it can be…

  • 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-18T14:29:21+00:00Added an answer on June 18, 2026 at 2:29 pm

    It turns out the Release build is causing issues. According to the log4net’s FAQ section, configuring log4net via assembly level attribute may behave different in DEBUG and RELEASE configurations.

    In my setup I was using a static readonly property (of a base controller) initialized upon declaration. This seemed to bug the logger configuration. I moved my Logger instance to an instance property of my Web Application type and changed my controller property to just return Application’s property. Now everything is working fine in all build configurations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Strange situation. If I have these tables: CREATE TABLE t1 (id INT, title VARCHAR(20),
I guess this is strange situation. I have a results table which contain 100k
I have a strange situation in regards to xml serialization... If I run MyApp.exe
I have a strange situation here. In my android app, I have a layout
I have a very strange situation. I have a large set of records to
I have a very strange situation. I´m working on a pretty big Java application
I have the next very strange situation and problem: .NET 4.0 application for diagram
I have very strange situation: I have asp:panel in my aspx code, in code
I have a strange situation where I can build a project with ant without
I have a strange situation which appears to indicate a GORM cacheing problem //begin

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.