Feedback: Add Auto Trimming of Log Files

Discussion in 'The Veterans' Lounge' started by Fanra, Jan 25, 2024.

  1. Warpeace Augur

    Seeing the game only has two default options log on/off they should have a petter way to delete, trim or archive the log file.
  2. I_Love_My_Bandwidth Mercslayer

    This is my log file archiver. It runs as part of a larger script when I launch EQ.

    Use if it you want to. :)

    Code:
    # This is a Powershell script.
    # EQ,GINA, EQLogParser, Gamparse, etc should be closed in order to run this.
     
    # This will find all EQlogs whose size exceeds the threshold size, compress them, archive them in a location you choose and append today's date to the filename.
    # After archiving an empty log file is created with the original filename.
    # Threshold is currently set to ~512MB (512000000 B)
     
     
    #####################  Directions  #######################
    # Copy/Paste this code into a new text file. Name it whatever you want. Save as a .ps1
    # In the $sourcePath paste your EQ logs directory.
    # In the $archivePath paste your EQ logs archive directory.
    # When ready, right-click and choose: Run With Powershell
     
    function Move-And-Compress-EqLogs {
        param (
            [string]$sourcePath = "C:\EverQuest\Logs\",
            [string]$archivePath = "C:\EverQuest\Logs\Archive\",
            [int]$thresholdSize = 512000000
        )
     
        # Create Archive directory if it doesn't exist
        if (-not (Test-Path -Path $archivePath -PathType Container)) {
            New-Item -Path $archivePath -ItemType Directory | Out-Null
            }
     
        # Get current date in the desired format (yyyyMMdd)
        $dateStamp = Get-Date -Format "yyyyMMdd"
     
        # Get all .txt files in the source directory starting with "eqlog"
        $files = Get-ChildItem -Path $sourcePath -Filter "eqlog*.txt" -File
     
        foreach ($file in $files) {
            if ($file.Length -gt $thresholdSize) {
                Write-Host $file.FullName :  ($file.Length/1024).ToString('F0')
                # Construct new file name with date stamp
                $newFileName = $file.BaseName + "_" + $dateStamp + ".zip"
                $newFilePath = Join-Path -Path $archivePath -ChildPath $newFileName
     
                # Compress the file
                Compress-Archive -Path $file.FullName -DestinationPath $newFilePath
                { wait-process -id $file Write-host }
     
                # Delete the original file
                Remove-Item $file.FullName
     
                # Create a new empty file with the original name
                $null | New-Item -Path $file.FullName -ItemType File
            }
        }
        Write-Host "EQLog Archival Process Complete."
        Return
    }
     
    Move-And-Compress-EqLogs
    Rijacki likes this.
  3. Warpeace Augur

    Completely missing the reason a native log trimmer is being asked for.
    Nennius likes this.
  4. Angahran Augur

    You do realize EQ is already monitoring the log file?
    Otherwise in game triggers would not work.
    Rijacki likes this.
  5. Angahran Augur

    So long as any in game trimmer has an 'Off' setting, go for it.
  6. Angahran Augur

    Making the check part of the LaunchPad is a good idea. That way it would have zero impact on the client.
    Szilent and Rijacki like this.
  7. Fanra https://everquest.fanra.info

    Just to mention, they had no idea that logging was on. They don't use GINA or any parsing or other software. They didn't and don't want logging on. But it got turned on somehow, they didn't know it was on, and their log file was 4 GB in size.

    They asked for me help when they kept getting the message that there was a problem getting the list of files for download and were unable to get past LaunchPad. That one was tough to fix. I finally fixed it and while doing so took a look at their log folder. Then I saw the 4 GB log file. They had no idea about logging and wanted it off. I turned it off for them and deleted the 4 GB log file. Now their EQ is much better.
  8. Waring_McMarrin Augur

    This is incorrect, the in game audio triggers are not looking at the logs rather what comes on the screen. You can turn logging off and they will still work with no problems.

    However it is monitoring the file as it is possible to have it deleted while it is being written to by the game and it will just recreate the file with no issues.
  9. Vumad Cape Wearer

    TLDR reply, /logautotrim

    Gina was used as an example, but it's not the only example. I play with some people in which every line of important chat channels is read to them because they struggle to see the text. A number of people who play were well into adulthood or nearing retirement when the game launched. The game is 25 years old. Do the math. I have no doubt that some people stay in EQ because they aren't able to learn how to play a new game. Auto log trimming is a completely reasonable request. It has nothing to do with GINA. /log exists, it creates performance problems, it has an easy fix, fix it.

    Talking about Dx11 fixes with a log trim in the same thread is asinine. I wish people would stop doing such things, but I know they wont. The difference between the workload of having /log and /logautotrim commands vs resolving graphical issues on a near infinite number of hardware/OS versions is so far apart it is nonsensical to bring it up. Talking about Dx11 performance here is nothing more than post dumping.
    Fanra likes this.