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 6088373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:58:37+00:00 2026-05-23T11:58:37+00:00

What are the better ways to achieve low overhead distributed logging on Azure?

  • 0

What are the better ways to achieve low overhead distributed logging on Azure?

  • 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-05-23T11:58:38+00:00Added an answer on May 23, 2026 at 11:58 am

    We use log4net as the logging library for our multi-tennant Azure Web Role. The log4net ADO.Net appender is used to log all errors to a SQL Azure database. To filter logs by client/user, we use a few log4net.GlobalContext properties, like so:

    log4net.GlobalContext.Properties["Domain"] = new Log4netDomainProvider();
    log4net.GlobalContext.Properties["Username"] = new Log4netUsernameProvider();
    

    Each “Provider” is just a simple class that overrides the ToString() method. When ToString() is called by log4net, we grab a value from the current session (this technique is discussed in this SO answer).

    public class Log4netDomainProvider
    {
        public override string ToString()
        {
            string retval = null;
    
            if (HttpContext.Current == null)
                retval = "HttpContext is null";
            else if (HttpContext.Current.Session == null)
                retval = "HttpContext.Current.Session is null";
            else
                retval = HttpContext.Current.Session["Domain"];
    
            return retval;
        }
    }
    

    I hope this addresses your question. If so, you might want to check out this good write-up on log4net logging contexts.

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

Sidebar

Related Questions

Are there any better ways to use constants in a JSP than: <%@ page
Do I use varchar(36) or are there any better ways to do it?
I'm working on one of those projects where there are a million better ways
One of the things about programming is that there are several ways to achieve
Where to start? Question is about two different ways to achieve the same thing,
Better yet, how can I make My Computer always open in Explorer as well?
Or better said: When to use array as a field data type in a
Even better would be if autoResize in latest branch would work as intended, but
For better description, +-----------------------+ | Desktop (screen) | | | | | | +----------+
any better way to write this ? $(this).parent().parent().find( dd ul).toggle(); update.. I am trying

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.