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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:24:13+00:00 2026-06-16T06:24:13+00:00

I am new to EnterpriseLibrary.Logging. In the web.config, under the loggingConfiguration, we have following

  • 0

I am new to EnterpriseLibrary.Logging. In the web.config, under the loggingConfiguration, we have following formatters:

<formatters>
    <add name="Default Formatter" template="&#xA;Timestamp: {timestamp(local)}&#xA;&#xA;Message: {message}&#xA;&#xA;Category: {category}&#xA;&#xA;Priority: {priority}&#xA;&#xA;EventId: {eventid}&#xA;&#xA;Severity: {severity}&#xA;&#xA;Title:{title}&#xA;&#xA;Machine: {machine}&#xA;&#xA;Application Domain: {appDomain}&#xA;&#xA;Process Id: {processId}&#xA;&#xA;Process Name: {processName}&#xA;&#xA;Win32 Thread Id: {win32ThreadId}&#xA;&#xA;Thread Name: {threadName}&#xA;&#xA;User Name: {userName}&#xA;&#xA; extended Properties: {dictionary({key} - {value}&#xA;)}" 
             type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    <add name="DBA Formatter" template="&#xA;Timestamp: {timestamp(local)}&#xA;&#xA;Message: {message}&#xA;&#xA;Category: {category}&#xA;&#xA;Priority: {priority}&#xA;&#xA;EventId: {eventid}&#xA;&#xA;Severity: {severity}&#xA;&#xA;Title:{title}&#xA;&#xA;Machine: {machine}&#xA;&#xA;Extended Properties: {dictionary({key} - {value}&#xA;)}" 
             type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</formatters>

In the code behind, we only set the message to the LogEntry. I wonder how the others parameters get set, for example the timestamp, category, priority, etc. I have added the username, but doesn’t work. Can anybody shed some light on me?

  • 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-16T06:24:15+00:00Added an answer on June 16, 2026 at 6:24 am

    Here’s the Microsoft article on those parameters: Configuring Formatters. It discusses the various tokens you can insert in a formatter.

    “Username” is not one of the pre-defined tokens. But you can (probably) get around that with the ExtendedProperties property of the LogEntry:

     LogEntry le = new LogEntry();
     le.ExtendedProperties.Add("username", "jsmith");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a config file like: <configSections> <section name=loggingConfiguration type=Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35/>
New to PHP and MySQL, have heard amazing things about this website from Leo
New to spring. I'm getting the following exception being caught: 2012-06-14 16:20:57,719 [http-8080-6] ERROR
New to wordpress and web design in general. I'm trying to setup a website
Let's say, for the sake of argument, that I have 30 asp.net web applications
I am using the Microsoft.Practices.EnterpriseLibrary Database tools and I'm having trouble creating a new
I'm using EntLib 4.1 for logging. When I have an exception handled in the
I have the following very basic stored procedure: CREATE PROCEDURE [dbo].[GetNumberToProcess] AS RETURN 999
I have been looking into refactoring some old code into a new WCF service,
The following code exists in LogEntry.cs in the Enterprise Library's Logging Application Block: private

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.