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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:10:37+00:00 2026-06-13T17:10:37+00:00

I have an ASP.NET website and I am doing logging with log4net. As logging

  • 0

I have an ASP.NET website and I am doing logging with log4net. As logging requirements change often, I want to enable PMs to modify the information that gets logged and also to be able to log extra information for debugging in production (i.e without having to recompile)

My plan is to expose certain values to log4net, for example the GET / POST params from context. To log such a param, the user would just go to the log4net config and do something like %message{userId}

I have found a way to do it using a property bag on log4net.ThreadContext but I am not sure if this doesn’t have side-effects, i.e. the values are persisted for too long.

Another way is to use a forwarding appender, and inject the extra values whenever the logger gets called, but I haven’t been able to implement this, there are not enough examples out there.

Any ideas?

  • 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-13T17:10:38+00:00Added an answer on June 13, 2026 at 5:10 pm

    Look at my answer to this question. The linked question and answer are specifically about adding the username from HttpContext.Current.User to the logfile, but it should be pretty easy to make a more generic solution that might fit your needs.

    It might provide you with some ideas of how to incorporate information from the HttpContext into your log4net logging. There are other good ideas in that thread as well.

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

Sidebar

Related Questions

Background: I have a website (ASP.NET MVC) where users can write/edit/delete a review. Doing
i have an asp.net-mvc website and i want to merge in some functionality from
I have a ASP.NET website where a thread is responible for doing some code
Currently I'm tasked with doing the daily build. We have an ASP.NET 2005 website
I have Asp.net website for domain A users with the Integrated Windows Authentication. Now
We have a ASP.NET website project. In the past, we had been using asmx
I have a asp.net website with a logo. When I go on facebook or
I have a ASP.NET website deployed to IIS with a couple of ashx that
I have a asp.net website in my local IIS and one of a page
I have an ASP.NET website containing the following <asp:UpdatePanel ID=UpdatePanel1 runat=server > <ContentTemplate> <asp:Label

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.