cancel
Showing results for 
Search instead for 
Did you mean: 

How to turn on debug logging docker images

rimisra
Champ in-the-making
Champ in-the-making

Hi There,

I am using the following public docker images from alfresco hub for starting up alfresco:

alfresco/alfresco-content-repository-community:6.2.1-A8

alfresco/alfresco-transform-core-aio:2.3.4

alfresco/alfresco-share:6.2.1

I wanted to check how to turn debug logging on for them? Is there an environment variable I could pass in to enable that?

Many thanks,

Richa

1 ACCEPTED ANSWER

abhinavmishra14
World-Class Innovator
World-Class Innovator

I wanted to check how to turn debug logging on for them? Is there an environment variable I could pass in to enable that?

 


For the services which are based upon spring boot e.g. 'alfresco-transform-core-aio', you can set debug log level via docker compose. But you can't do that for acs/share. I am afraid that this is not an option available via docker compose for acs/share.

example of spring boot based apps like transform services:

transform-core-aio:
        image: alfresco/alfresco-transform-core-aio:2.3.4
        mem_limit: 1536m
        environment:
            JAVA_OPTS: "
            -Dlogging.level.org.alfresco.transform.common.TransformerDebug=debug 
-Dlogging.level.org.alfresco.transform.router.TransformerDebug=debug
-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80" ports: - 8090:8090

or for enterprise router on a package level:

transform-router:
image: local.nexus.docker:8083/alfresco/alfresco-transform-router:${TRANSFORMATION_ROUTER_TAG}
deploy:
resources:
limits:
memory: 512m
environment:
JAVA_OPTS: " -XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80
-Dlogging.level.org.alfresco.transform.router=error
"
ACTIVEMQ_URL: "nio://activemq:61616"
CORE_AIO_URL: "http://transform-core-aio:8090"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- "8095:8095"
links:
- activemq

If you are using enterprise version, you have an option in admin console to set/enable/disable log settings (these settings are not presisted and on restart any setting done via admin console will be lost) found under support-tools

You seems to be using community version, and support-tools is not by default available for this version. You can use this add-on : https://github.com/OrderOfTheBee/ootbee-support-tools to get the similar options. 

You would have to apply the amps on both alfresco and share war file deployed under the containers. However, if you terminate the containers all these additions will be lost. 

The best option would be to use DockerFile in combination with docker-compose and build the image with any add-ons/extensions, custom log4j etc. 

Here is an example of DockerFile usage in docker-compose:

https://github.com/abhinavmishra14/change-acs-share-port-demo/blob/master/docker-compose.yml#L15

https://github.com/abhinavmishra14/change-acs-share-port-demo/blob/master/configs-to-override/alfres...

You can also take a look at this thread on how to copy/apply extensions via dockerfile:

https://github.com/Alfresco/acs-community-deployment/issues/131#issuecomment-691300550

Additonally, if you wish to connect to the containers, you can do it using below given command and update the log levels as usual you do on any linux sever where acs is deployed.

https://docs.alfresco.com/6.2/tasks/log-levels-set.html

Connect to a container:

docker exec -i -t <container_Name/id> /bin/bash

example:
docker exec -it docker_alfresco_1 /bin/bash
~Abhinav
(ACSCE, AWS SAA, Azure Admin)

View answer in original post

1 REPLY 1

abhinavmishra14
World-Class Innovator
World-Class Innovator

I wanted to check how to turn debug logging on for them? Is there an environment variable I could pass in to enable that?

 


For the services which are based upon spring boot e.g. 'alfresco-transform-core-aio', you can set debug log level via docker compose. But you can't do that for acs/share. I am afraid that this is not an option available via docker compose for acs/share.

example of spring boot based apps like transform services:

transform-core-aio:
        image: alfresco/alfresco-transform-core-aio:2.3.4
        mem_limit: 1536m
        environment:
            JAVA_OPTS: "
            -Dlogging.level.org.alfresco.transform.common.TransformerDebug=debug 
-Dlogging.level.org.alfresco.transform.router.TransformerDebug=debug
-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80" ports: - 8090:8090

or for enterprise router on a package level:

transform-router:
image: local.nexus.docker:8083/alfresco/alfresco-transform-router:${TRANSFORMATION_ROUTER_TAG}
deploy:
resources:
limits:
memory: 512m
environment:
JAVA_OPTS: " -XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80
-Dlogging.level.org.alfresco.transform.router=error
"
ACTIVEMQ_URL: "nio://activemq:61616"
CORE_AIO_URL: "http://transform-core-aio:8090"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- "8095:8095"
links:
- activemq

If you are using enterprise version, you have an option in admin console to set/enable/disable log settings (these settings are not presisted and on restart any setting done via admin console will be lost) found under support-tools

You seems to be using community version, and support-tools is not by default available for this version. You can use this add-on : https://github.com/OrderOfTheBee/ootbee-support-tools to get the similar options. 

You would have to apply the amps on both alfresco and share war file deployed under the containers. However, if you terminate the containers all these additions will be lost. 

The best option would be to use DockerFile in combination with docker-compose and build the image with any add-ons/extensions, custom log4j etc. 

Here is an example of DockerFile usage in docker-compose:

https://github.com/abhinavmishra14/change-acs-share-port-demo/blob/master/docker-compose.yml#L15

https://github.com/abhinavmishra14/change-acs-share-port-demo/blob/master/configs-to-override/alfres...

You can also take a look at this thread on how to copy/apply extensions via dockerfile:

https://github.com/Alfresco/acs-community-deployment/issues/131#issuecomment-691300550

Additonally, if you wish to connect to the containers, you can do it using below given command and update the log levels as usual you do on any linux sever where acs is deployed.

https://docs.alfresco.com/6.2/tasks/log-levels-set.html

Connect to a container:

docker exec -i -t <container_Name/id> /bin/bash

example:
docker exec -it docker_alfresco_1 /bin/bash
~Abhinav
(ACSCE, AWS SAA, Azure Admin)