Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

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,187
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,099
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