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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:05:06+00:00 2026-06-13T14:05:06+00:00

I have an installable ASP.Net application that is logging using Common.Logging. When writing log

  • 0

I have an installable ASP.Net application that is logging using Common.Logging.

When writing log messages ie:

_log.InfoFormat(CultureInfo.???, "{0}: Writing to the Log", DateTime.UtcNow);

I am confused about which culture I should be using. The result I want is that the log messages are formatted using the server’s regional settings. That way when administrators install the application they have control over how their log messages are formatted.

There are fours options but none seem to be the correct choice:

  • CultureInfo.CurrentCulture: this seems like it would be the correct choice for a windows app but ASP.Net is changing this to match the user browsing the site – so it’s appropriate for formatting content to display to the user but not for writing to the log.
  • CultureInfo.CurrentUICulture: similar problems to CurrentCulture – will match the current user browsing the site.
  • CultureInfo.InstalledUICulture: the system installed culture – appears to relate to the copy of windows installed but not alterable by the user. Apparently this one is a bit useless
  • CultureInfo.InvariantCulture: this is not user configurable. I am wondering if this is the best of the four options here though because at least it is consistent and won’t vary by who is browsing the site/the media windows was installed from.

I am left wondering if I need to add explicit configuration in my web.config for the system culture so the installer can choose a culture. The answer I really want is whatever CultureInfo.CurrentCulture was before ASP.Net changed it to match the current user.

Note: I know I can turn off ASP.Net changing the CurrentCulture per user but the UI relies on this behaviour.

  • 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-13T14:05:07+00:00Added an answer on June 13, 2026 at 2:05 pm

    Admins like to have control over the logs. Telling them to go configure their server culture so that the logs are in a particular format doesn’t seem like the best solution to me.

    Adding a configuration option into web.config is a good idea. This will let the admin configure the log format as required.

    Rather than ask the user, you could make an intelligent guess while installing using CultureInfo.CurrentCulture. If the user wants it to be something different, he can always change it.

    If you do want to take it from CultureInfo.CurrentCulture rather than configuration, you can pick it during the Application_Start event, and keep it in the application context.

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

Sidebar

Related Questions

I have created a program in Java using eclipse that contains a couple of
How can I make a java program installable? I have an application saved in
We have an MSI installer for a .Net WinForms app for Windows XP that
I have an Android application that uses the well known Strategies for Legacy Applications
I need to open and read a Dbase file in my ASP.NET application. When
So the windows have different versions of .net framework, 1.0, 1.1, 2.0, 3.0, 3.5
I have created desktop application wherein there are three projects include. any one can
I have two Django Projects where I use a lot of common models. Custom
Supposing I have a merge module that installs a file MyFile.txt to a certain
I maintain an installable Django app that includes a regular test suite. Naturally enough

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.