[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

Trace

in app.config
==============

<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup>
<system.diagnostics>
    <trace autoflush="true"  indentsize="4">
      <listeners>
        <add name="TraceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="E:\trace.log" traceOutputOptions="DateTime" />
        <remove name="Default" />
      </listeners>
    </trace>
  </system.diagnostics>


</configuration>


and now i am using  following line in the code in c#


Trace.WriteLine("The Mail sending started ... ");



I am using this in C# Windows Applications.

But it is not writing to that trace file.

the file is existing in the correct path and it is having all the permissions

but i do not understand why it is not writing. do i missed any thing ,

 is the application also requried any permissions , if so how and where should i give the permissions


please guide me
0
praveen1981
Asked:
praveen1981
1 Solution
 
apeterCommented:
Hope below link gives you more info. Hope you created the trace object as given in the link or followed as given in config file.

http://msdn.microsoft.com/en-us/library/system.diagnostics.textwritertracelistener.aspx
0
 
praveen1981Author Commented:
Thanks for your solution, but that doesn't worked out here and eventually we moved in to event log as suggested by lead.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now