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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:40:57+00:00 2026-05-27T16:40:57+00:00

Using Enterprise Library 5.0 Logging Block in .NET 4.0 which is the only Block

  • 0

Using Enterprise Library 5.0 Logging Block in .NET 4.0 which is the only Block I am using I was trying to customize information being logged to include Call Stack, calling Assembly name and perhaps Line Numbers. So I went to text Formatter that I created and added a few entries:

Method: {property(MethodName)}{newline}
Call Stack:{property(CallStack)}

so after that matching text formatter config file entry now looks like this:

    <formatters>
        <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            template="Timestamp: {timestamp} &#xA;Message: {message}{newline}&#xA;Category: {category}{newline}&#xA;Priority: {priority}{newline}&#xA;EventId: {eventid}{newline}&#xA;Severity: {severity}{newline}&#xA;Title:{title}{newline}&#xA;Machine: {localMachine}{newline}&#xA;App Domain: {localAppDomain}{newline}&#xA;ProcessId: {localProcessId}{newline}&#xA;Process Name: {localProcessName}{newline}&#xA;Thread Name: {threadName}{newline}&#xA;Win32 ThreadId:{win32ThreadId}{newline}&#xA;Extended Properties: {dictionary({key} - {value}{newline})}{newline}&#xA;Method: {property(MethodName)}{newline}&#xA;Call Stack:{property(CallStack)}"
            name="Text Formatter" />
    </formatters>

You can see new added entries in there. But when I run it my logging entries look like this:

----------------------------------------
Timestamp: 12/15/2011 9:51:48 PM 
Message: Starting up the application

Category: General

Priority: -1

EventId: 0

Severity: Information

Title:

Machine: HCCLI066

App Domain: WindowsFormsApplicationTest1.vshost.exe

ProcessId: 2488

Process Name: C:\Projects\WindowsFormsApplicationTest1\bin\Debug\WindowsFormsApplicationTest1.vshost.exe

Thread Name: 

Win32 ThreadId:2636

Extended Properties: 

Method: <Error: property MethodName not found>

Call Stack:<Error: property CallStack not found>

Is there anything else I need to do to see those properties logged? How do I add completely custom property, like “Line Numbers” for example?

  • 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-27T16:40:58+00:00Added an answer on May 27, 2026 at 4:40 pm

    This article does a bit more than you need, but it’s reliable:

    http://www.codeproject.com/KB/architecture/DistributedLogging.aspx

    Another I found:

    http://www.dotnetscraps.com/dotnetscraps/post/how-to-configure-and-use-the-logging-application-block.aspx

    The later applies to 4.1, but it’s probably a good place to start and then verify against the MSDN documentation for “Whats New” in 5.0 with the Log Block.

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

Sidebar

Related Questions

I am using the patterns & practices enterprise library (p&p EntLib) logging block to
I am using the Logging Application Block (of Microsoft Enterprise Library 5.0) to log
I'm using the Enterprise Library Exception handling block in an ASP.NET web application. I
I'm using the Enterprise Library Logging application block to allow my application to log
I am using Enterprise Library 4.x for my exception handling logging (ASP.NET application). Here
I created a WCF service for logging using the enterprise library logging block. The
Using .NET 3.5, ASP.NET, Enterprise Library 4.1 Exception Handling and Logging blocks, I wrote
I am using enterprise library logging block 5.0. My solution has over 20 projects,
I am using Microsoft Enterprise library 5.0 for application logging of my .net application.
I'm using Enterprise Library 4.1 and I've configured the Logging Application Block to log

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.