Background Thread Error Logging

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm running a long running process on a background thread in an ASP.NET
application and not sure about how to get the path since the
HttpContext.Current object is null. If there is no context, how does one get
the path for the error log?
 
When you initiated thread, you can always pass the error log path as a
parameter. If your error log path stays the same thorugh out the processing,
this should work.
 
Naveen,

Thanks for the suggestion. That would definitely work. I found, though,
that using

System.AppDomain.CurrentDomain.BaseDirectory

will return the path for the application folder even when there is no
HttpContext.Current object, so I'm just using that. If I run into problems,
your method may come in handy!

Naveen K Kohli said:
When you initiated thread, you can always pass the error log path as a
parameter. If your error log path stays the same thorugh out the processing,
this should work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top