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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:23:45+00:00 2026-05-26T03:23:45+00:00

How can I format the Timestamp data that is printed when you set the

  • 0

How can I format the Timestamp data that is printed when you set the TraceOutputOptions = TraceOptions.Timestamp?

Im getting something like:
Timestamp=41329240725 (real value that was written on the output text file)

EDITED:
I want something like 10:22:34.32938. How shoud I configure the TextWriterTraceListener to achieve that?

  • 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-26T03:23:46+00:00Added an answer on May 26, 2026 at 3:23 am

    Do you really want to log the time that the message was written? If so, you want to use TraceOptions.DateTime. Note, that according to MSDN, the time is written as UTC.

    If you want more control over the format of the time (including if you want it to be expressed in something other than UTC), then you will probably have write your own custom TraceListener, or find one that will do what you want.

    One useful add on for System.Diagnostics is Ukadc.Diagnostics. With it you can easily add custom formatting to your log messages (similar to what you can do with log4net and NLog).

    Here are some other links to answers that I have provided in the past to logging questions that you might find useful:

    When should I use Tracing vs Logger.NET, Enterprise Library, log4net or Ukadc.Diagnostics?

    When do I need more than one TraceSource in code?

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

Sidebar

Related Questions

first time SO user :) I know that I can format a number like
How can i format currency related data in a manner that is culture aware
How can I format a timestamp from MySQL to a date value in PHP?
I'm getting data from a CSV file in the format {timestamp}, {data1}, {data2} .
How can I format Floats in Java so that the float component is displayed
How can I format data coming from a DataBinder.Eval statement in an ASPX page?
How can I format a float so that it doesn't contain trailing zeros? In
Running PostgreSQL 7.4(Yep we're upgrading) Field is data type: timestamp with time zone Format
I'm looking for a compression library/format with the following abilities: Can compress my data
I need to convert a SQL Server timestamp format (stored on Timestamp java data

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.