Debuging Asqatasun

Hi guys! I’m trying to debug some queries that i wrote in CriterionStatisticsDAOImpl and WebResourceStatisticsDAOImpl. What should i do to write LOGGER.DEBUG messages to a file and see them? I tried to configure Asqatasun/engine/asqatasun-api/src/test/resources/ file like this:

 # Set root logger level to DEBUG and its only appender to CONSOLE.
#sortie console

# Direct log messages to a log file

#Redirect to Tomcat logs folder

but it didn’t work…Thanks!

Also replaced all INFO appearances by DEBUG in /Asqatasun/web-app/asqatasun-web-app/target/asqatasun-web-app-4.1.0-SNAPSHOT/WEB-INF/classes/ but everytime i compile Asqatasun it changes back to INFO.

Hi @nivak91

As you may have already read, you’ve got an explanation on enabling logging in Asqatasun in the doc.

Before going on, one important thing must be understood in the build process:

  • Your sources are located in, say, /home/nivak91/sources/asqatasun/. When you code, these are the files you modify
  • When you build (mvn clean install), the artifacts (artifact = product of the build) are in the target/ directories.
  • Once built, you’ll want to test, thus install your Asqatasun:
    • If you never installed Asqatasun, grab the whole archive (from /home/nivak91/sources/asqatasun/web-app/asqatasun-web-app/target/, file asqatasun-4.1.0-SNAPSHOT.i386.tar.gz), unpack it and install Asqatasun (this is the long way).
    • If you’ve already installed Asqatasun on your machine, and you did not modify the DB schema, then you can copy the WAR file (grab it from /home/nivak91/sources/asqatasun/web-app/asqatasun-web-app/target/asqatasun-web-app-4.1.0-SNAPSHOT.war) and copy it into your Tomcat webapp directory, typically /var/lib/tomcat7/webapp/, no need to restart tomcat, just wait for the deployment to be done. This is the short way.
    • If you don’t want to bother with the installation stuff, you can use the Compile and build docker image script, which does what its name suggests with plenty of usefull options (-h option will give you everything). This is the :sunglasses: way.

That being said, from the paths you mention, I think you modified the that is deployed (i.e. after the build is done). Thus that’s no surprise you’ve got to modify it after each build.

To avoid this, you’d better modify directly the from the sources, which is located in <path-to-asqatasoun-sources>/web-app/asqatasun-web-app/src/main/resources/

Your files (CriterionStatisticsDAOImpl and WebResourceStatisticsDAOImpl) are in the module org.asqatasun.entity.dao, so add the following line to your

Hope this helps !


hi @nivak91,

in a few words: don’t edit files in target directories and edit files in src directories

for the following file:

edit this file:

1 Like

Ok guys @fabrice @mfaure i edited web-app/asqatasun-web-app/src/main/resources/ like this: Changed ERROR to DEBUG in log4j.rootLogger=DEBUG,FILE_APP and also added = DEBUG because i want to debug under this module. But when i add something like LOGGER.debug(“mesage”) in a class after of course declaring private static final Logger LOGGER = Logger.getLogger(SomeClass.class) in the class i want to debug i get nothing in /var/log/asqatasun.log…

hi @nivak91,

can you put here your file ?
can you tell us if you use Docker or Tomcat on your host ?

I have installed asqatasun on localhost:8080 and docker on localhost:8085.
This is

# Set root logger level to DEBUG and its only appender to CONSOLE.
# console output
# file output

# file output
log4j.appender.FILE_APP.layout.ConversionPattern=%d{dd-MM-yyyy HH:mm:ss:SSS} %-4r %-5p %c %x - %m%n

# Change the level of messages for various packages. = DEBUG 

I tested your file and it works:

DEBUG  - Chain processed normally
DEBUG  - SecurityContextHolder now cleared, as request processing completed
DEBUG  - Publishing event:[source=org.apache.catalina.session.StandardSessionFacade@55c6b659]

Is this the content of var/lib/asqatasun.log?

yes, this is the content of var/lib/asqatasun.log in docker.

I use these following command lines:

docker/ -l -s ${PWD} -d docker/single-container-SNAPSHOT-local  --skip-build-test --use-sudo-docker
sudo docker logs -f  asqa

can you tell us the path off your class where you added something like LOGGER.debug(“message”)?

The path is /Asqatasun/web-app/asqatasun-web-app/src/main/java/org/asqatasun/webapp/controller/

Ok finally worked! Thanks a lot!