Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable AspectJ dump files "ajcore.txt"

I've got a Tomcat webapp where I'm using AspectJ for logging and metrics, everything seems fine, but it keep creating several files like ajcore.20150310.113255.780.txt in the root folder. There is no exception in this files, so they are completely useless.

I've found this: https://eclipse.org/aspectj/doc/released/pdguide/ajcore.html

That states that using org.aspectj.weaver.Dump.exception="false" should disable this behavior, yet the files are still appearing. Is there any other way to completely disable the creation of this files? The other option mentioned: org.aspectj.dump.directory would also solve the problem, but it doesn't seem to work either.

This is the content of the file in case it helps for anything:

---- AspectJ Properties --- 
AspectJ Compiler 1.7.1 built on Thursday Sep 6, 2012 at 16:39:22 GMT
---- Dump Properties --- 
Dump file: ajcore.20150310.113255.780.txt 
Dump reason: org.aspectj.weaver.BCException 
Dump on exception: true 
Dump at exit condition: abort
---- Exception Information ---
---- System Properties --- 
... My system properties here
---- Command Line --- Empty
---- Full Classpath --- Empty
---- Compiler Messages --- Empty
like image 498
jhurtado Avatar asked Mar 10 '15 19:03

jhurtado


1 Answers

Either of the following options may help:

  1. Executing this code before any AspectJ weaving occurs (if possible): org.aspectj.weaver.Dump.setDumpOnExit(org.aspectj.bridge.IMessage.ABORT)
  2. Adding this system property definition to your java command-line: -Dorg.aspectj.weaver.Dump.condition=abort
like image 113
Christian Conti-Vock Avatar answered Nov 01 '22 08:11

Christian Conti-Vock