开发者

Where is the Microsoft.VisualBasic.Logging temp path exactly

I am making a small change to an existing application so that users can email us the log file when things go wrong. Even though it is c# the app is using Microsoft.VisualBasic.Logging.FileLogTraceListener.

This gets setup like this:

FileLogTraceListener fileLogTraceListener = listener as FileLogTraceListener;
fileLogTraceListener.Lo开发者_JAVA技巧cation = LogFileLocation.TempDirectory;

My question is: Where do the log files go?

Is it the same place as Path.GetTempPath() ?

I have seen a bunch of other posts asking similar questions but I need to be sure that whatever computer / operating system this app runs on it is able to pick up the logs. I take it there is no way to look inside the FileLogTraceListener class to see what it does when working with temp?


Failing documentation, you could:

  • Use Reflector to look at the source
  • Use Process Monitor from SysInternals to see what IO your process is doing.
  • Write a test app that makes two files, one with Path.GetTempPath() and one with VB Logger.


It is the same place as Path.getTempPath(). Reflector showed me this:

private string get_LogFileName()
{
    string tempPath;
    switch (this.Location)
    {
        case LogFileLocation.TempDirectory:
            tempPath = Path.GetTempPath();
            break;

+1 to Nate Bross - reflector helped to find the answer

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜