Skip to main content
1-Visitor
August 23, 2016
Solved

Delete Application Logs with a script

  • August 23, 2016
  • 3 replies
  • 3429 views

Hello,

Is there a way to delete application logs entries with a script from ThingWorx ? I saw in the LogView mashup that we have access to the ApplicationLog resource that has a QueryLogEntries function, but i couldn't find any function similar to deleteStreamEntry or purgeStreamEntries anywhere.

Any advice on this ?

Thank you,

Veronica

Best answer by Aanjan

Veronica, the Logging Subsystem has settings where you can configure the retention for logs (default is 100mb and 7 days). The logs are usually dynamically generated, so we don't recommend running the purge to clear out existing entries though a custom service.

3 replies

Aanjan5-Regular MemberAnswer
5-Regular Member
August 23, 2016

Veronica, the Logging Subsystem has settings where you can configure the retention for logs (default is 100mb and 7 days). The logs are usually dynamically generated, so we don't recommend running the purge to clear out existing entries though a custom service.

5-Regular Member
August 23, 2016

Why do you want to do this? I don't believe there is any built-in functionality for this in ThingWorx, but you could always just delete or rename the ApplicationLog.log file found within the /ThingWorxStorage/logs folder.

Hope this helps!

Tori

vmihai1-VisitorAuthor
1-Visitor
August 24, 2016

Thank you for your answers. I want to prevent the space on the hard drive from increasing  because of the logs. I will look into the Logging Subsystem and set it up from there.