3 Replies Latest reply on Feb 14, 2019 7:00 AM by michael.lowden

    TIP: Tableau Desktop and Prep Log Files -- really large?

    michael.lowden

      [EDIT] --- I've updated my approach in a comment below using Symbolic Links instead.

       

      Just a tip for anyone interested.

       

      I've come to realize two things:

      - my local Log folders were really big (combined ~400MBs) -- fairly fresh OS and install of latest versions

      - they aren't useful unless troubleshooting

      - I was burning ~8-9 GBs of upload daily while working with Tableau Desktop/Prep .... yes, GigaBytes. And my network was always kind of laggy due to this.

       

      I have both OneDrive and Google Backup & Sync installed. Thus, with the logs located where they are both of these tools were backing up the log/txt files every time Tableau touched them. Most files were 3-4 MBs, but one (Desktop) was 200MBs and was touched continuously daily. I've since purged the logs (keeping just the empty CrashDumps folder) and everything is fine. But now my PC is oddly more responsive online because 100% of the UL isn't being consumed by log backups all day long.

       

      Anyway. Just a tip in case others are in a similar boat.

       

      Check your repository\log folders as they may too be really big and constantly backed up either by something similar, or just a corporate solution you aren't aware of. Either way, it's "wasted" bandwidth as is.

       

      What have I done to stay on top of it?

      - found both log folders (Desktop & Prep are discrete)

      - created a PowerShell script (c:\purge-tableau-logs.ps1):

      Remove-Item -path 'C:\Users\UserFolder\OneDrive\Documents\My Tableau Repository\Logs\*' -Include *.txt, *.log

      Remove-Item -path 'C:\Users\UserFolder\OneDrive\Documents\My Tableau Prep Repository\Logs\*' -Include *.txt, *.log

      # notes: don't use $Env:userprofile as this script may run as the System-User

      #      : remove the \OneDrive\ if you don't use OneDrive

      #      : change \UserFolder\ to your user folder

      - setup shutdown trigger for the script in my GPEdit.msc > Computer Configuration > Windows Settings > Scripts. I used a 'shutdown' (instead of login/logoff) script so the files won't be there on a fresh-boot (with background backups). Or use the User-Config version for a login/logoff trigger instead of a reboot trigger. Whatever suits your needs.

        * note: I did have to enable script execution in PowerShell with :  set-executionpolicy remotesigned  : via PowerShell as Admin.

       

      Now. Just rebooting will purge my logs, but they'll hang out and stay small-ish during the day if I need to submit them for assessment.

       

      If you have a more elegant solution. I'm happy to hear it. I looked inside Desktop and couldn't find any log-control so I just made my own solution instead.

       

      Message was edited by: Michael Lowden. to add a better solution in the comments

        • 2. Re: TIP: Tableau Desktop and Prep Log Files -- really large?
          michael.lowden

          I'm about to edit my perspective ... check back soon.

          • 3. Re: TIP: Tableau Desktop and Prep Log Files -- really large?
            michael.lowden

            I've changed my approach a little. Allowing for the 'best of both worlds'.

             

            WHY: Keep my original repository locations to ensure backups/updates/etc. still work without any effort to make sure the obscure location is backed up. All while still keeping the LOGS out of the backup for size/performance.

             

            REQUIREMENTS: Admin privileges.

             

            STEPS: (example within Tableau Desktop, but similar to Tableau Prep just adjust folder names)

            1. Take note of your current Repository locations inside Desktop/Prep. We'll call this <OriginalRepo>
            2. Exit the application
            3. Create a new LOG area. I used "C:\PROGRAM_LOGS\"
            4. Create empty child folders for your desired apps: ex: "C:\PROGRAM_LOGS\Tableau Desktop\"
            5. Copy all the contents from "<OriginalRepo>\Logs" to "C:\PROGRAM_LOGS\Tableau Desktop\"  (no need for Log subfolder due to parent already being a dedicated "log" area)
            6. Delete the "<OriginalRepo>\Logs" folder (the next step will recreate it)
            7. Create Symbolic Link for Log folder to new location (obviously update <OriginalRepo> to appropriate location):
              • This needs to be run in Command as the Administrator
                • mklink /J "<OriginalRepo>\Logs" "C:\PROGRAM_LOGS\Tableau Desktop"
              • note: be sure to use /J (lookup MKLINK help for explanation, but /D will create a "shortcut", not a direct hard-link)
              • ex: mklink /J "C:\Users\Username\OneDrive\Documents\My Tableau Repository\Logs" "C:\PROGRAM_LOGS\Tableau Desktop"
            8. (optional) keep/update the PowerShell script from original post to clean the new directory(s) to keep them small. As mine grew to 400MBs again yesterday with all the work. Hence this reconsidered solution
            9. Done, you can now use your app(s) as normal and you'll notice the Logs are generated in the new redirected folder instead of the original

             

            WHAT HAPPENS NOW:

            All your original folder contents will be backed up to GoogleBackup/OneDrive/DropBox/etc., but the "Logs" folder is now a special kind of traversable shortcut that the actual shortcut gets backed up not the data within. Just like any other shortcut, but when you follow it you'll notice the address doesn't jump to the target. It simply appears as if you're now in the child directory of the original parent folder. Allowing your program to 'think' it's putting Logs in the original folder, but in actuality they're redirected outside of your MyDocuments zone so that stays reasonably small without Logs.