How to output access logs to console with other logs via 'sonar.log.console=true'

  • which versions are you using - SonarQube 7.9.2
  • what are you trying to achieve - Output access.log to console with other logs
  • what have you tried so far to achieve this - Read topics here, have an idea that I want to ask if it’s possible.

As stated above, I would like to output the access logs to the console along with the other logs. Is there a way to expand the sonar.log.console property to include the the access logs as well? Thinking maybe there is a way to extend what is included in the sonar.log.console property. If not, could anyone recommend another way?

1 Like

Found a workaround. I use the Docker image of SonarQube, so I copied the run.sh file into my repo and mimicked the tail of the es.log:

> exec tail -F ./logs/access.log &

Then in my Docker file, I add the following:

> COPY run.sh $SONARQUBE_HOME/bin/
> 
> RUN chgrp -R 0 /opt/sonarqube/bin && \
>     chmod -R g+x /opt/sonarqube/bin/run.sh

And now I have the access log being sent to the console.

Again, if there is a better way to do this, please let me know.
Just wanted to provide my current workaround in case anyone else needs the same.