Best Location for app-generated log files

Mark Olbert 1 Reputation point
2022-03-30T14:59:07.737+00:00

I'm new to packaging apps for the Microsoft Store. I have an app that's been accepted, and published, in the Store but it fails during launch after being installed on a test machine (it runs fine on my development machine).

It generates a log file which I would like to review on the test machine to help figure out what's going wrong. However, those log files get written to the folder containing the app's executable, that being the traditional place for a desktop app to write such files. From what I've read about packaged apps that can't/won't work. Even if it did, it's hard/impossible for even an admin on the test machine to access the folder where the app is installed.

What is the preferred/best location for app-generated log files for packaged apps? The user's AppData/Local folder for the app? Or somewhere else?

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
654 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Li - MSFT 30,541 Reputation points Microsoft Vendor
    2022-03-31T06:39:15.337+00:00

    Hello,

    Welcome to Microsoft Q&A!

    What is the preferred/best location for app-generated log files for packaged apps? The user's AppData/Local folder for the app? Or somewhere else?

    There is no best location. It depends on your requirement where you place the log file. You could put the file wherever your app has permission. If you are developing a UWP app, you could check this document- File access permissions about the file permission that UWP apps have and choose a place that is suitable for your requirement.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.