• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Delete logs automatically?

Junior Spellweaver
Joined
May 7, 2023
Messages
103
Reaction score
17
1685358012646 - Delete logs automatically? - RaGEZONE Forums


Is there a way to have it set up to delete these logs daily or upon closing the client?
I would like them to do logs while the server is online, but delete them whenever I close the server for the day/night.
 

Attachments

You must be registered for see attachments list
Joined
Mar 29, 2019
Messages
1,032
Reaction score
1,192
View attachment 236306

Is there a way to have it set up to delete these logs daily or upon closing the client?
I would like them to do logs while the server is online, but delete them whenever I close the server for the day/night.

I suggest you to do this modification first,

Edit ServerConfig.xml and go to "LogConfig" node and leave it as this,

Code:
<LogConfig>
    <Directories>
      <Directory name="Logging" path=".\Logs\Logging" />
      <Directory name="Logged" path=".\Logs\Logged" />
      <Directory name="ChatLogging" path=".\Logs\ChatLogging" />
      <Directory name="ChatLogged" path=".\Logs\ChatLogged" />
      <Directory name="NHNChat" path=".\Logs\NHNChatLog" />
      <Directory name="Console" path=".\Logs\" />
      <Directory name="UserDump" path=".\Logs\UserDump" />
    </Directories>
    <DisabledChatType />
  </LogConfig>

This will make that all logs will be placed at Logs folder and not in the root bin folder.

About the task,

Create a "CleanLogs.ps1" file with the following content,

Code:
Get-ChildItem -Path "D:\TERA_SERVER" -Recurse -Include *.log,*.log2 -Force | Remove-Item -Force

and create a batch file with the following content,

Code:
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'D:\TERA_SERVER\CleanLogs.ps1'"

Save it as CleanLogFile.bat (or what ever you want)

Then add it (CleanLogFile.bat) to your windows task scheduler
 
Last edited:
Upvote 0
Junior Spellweaver
Joined
May 7, 2023
Messages
103
Reaction score
17
Yeah man, you really need to delete them periodically.
I myself have not found another way :unsure:
Yup, they add up real fast if you're restarting the server 10x+ a day working on things, like I do :p

Gets annoying, I wish they'd auto-delete upon shutting down the server each time.

I suggest you to do this modification first,

Edit ServerConfig.xml and go to "LogConfig" node and leave it as this,

Code:
<LogConfig>
    <Directories>
      <Directory name="Logging" path=".\Logs\Logging" />
      <Directory name="Logged" path=".\Logs\Logged" />
      <Directory name="ChatLogging" path=".\Logs\ChatLogging" />
      <Directory name="ChatLogged" path=".\Logs\ChatLogged" />
      <Directory name="NHNChat" path=".\Logs\NHNChatLog" />
      <Directory name="Console" path=".\Logs\" />
      <Directory name="UserDump" path=".\Logs\UserDump" />
    </Directories>
    <DisabledChatType />
  </LogConfig>

This will make that all logs will be placed at Logs folder and not in the root bin folder.

About the task,

Create a "CleanLogs.ps1" file with the following content,

Code:
Get-ChildItem -Path "D:\TERA_SERVER" -Recurse -Include *.log,*.log2 -Force | Remove-Item -Force

and create a batch file with the following content,

Code:
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'D:\TERA_SERVER\CleanLogs.ps1'"

Save it as CleanLogFile.bat (or what ever you want)

Then add it (CleanLogFile.bat) to your windows task

Thanks, I'll try some of this as it seems mine isn't set up.
1685372785116 - Delete logs automatically? - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Upvote 0
Joined
Sep 21, 2013
Messages
2,319
Reaction score
3,124
Code:
<LogConfig>
    <Directories>
      <Directory name="Logging" path=".\Logs\Logging" />
      <Directory name="Logged" path=".\Logs\Logged" />
      <Directory name="ChatLogging" path=".\Logs\ChatLogging" />
      <Directory name="ChatLogged" path=".\Logs\ChatLogged" />
      <Directory name="NHNChat" path=".\Logs\NHNChatLog" />
      <Directory name="Console" path=".\Logs\" />
      <Directory name="UserDump" path=".\Logs\UserDump" />
    </Directories>
    <DisabledChatType />
  </LogConfig>
Good idea!! That's enough for me...
Thanks argeus99
 
Upvote 0
Junior Spellweaver
Joined
May 7, 2023
Messages
103
Reaction score
17
Here's some screenshots to configure the windows task,

Enferno - Delete logs automatically? - RaGEZONE Forums


This will trigger the task to execute every 6hrs, if you only want to delete logs daily then uncheck "Repeat Task every..."

Enferno - Delete logs automatically? - RaGEZONE Forums


Enferno - Delete logs automatically? - RaGEZONE Forums


Enferno - Delete logs automatically? - RaGEZONE Forums
Yeah thanks a lot for this! This will definitely help :)
 
Upvote 0
Back
Top