Monitor and log the censhare WP and Keycloak related services.


Work with censhare WP services

Services:

  • censhare Server

  • censhare.cloud-gateway

  • censhare.static-resource-server

  • keycloak

  • censhare.google-ai

  • social.media.service

Check all running services: 

systemctl status  
CODE

Check running censhare services (does not include Keycloak): 

systemctl status censhare.*  
CODE

Check for a certain service: 

systemctl status SERVICE_NAME
CODE

Start a service: 

sudo systemctl start SERVICE_NAME
CODE

Restart a service: 

sudo systemctl restart SERVICE_NAME 
CODE

Stop a service: 

sudo systemctl stop SERVICE_NAME
CODE

For more information, see How to administrate censhare related systemd services.

Monitoring

Monitoring for censhare WP services is activated by default. 

The health check endpoint for load balancers, for example, is usable like this:

curl -s http://localhost:9000/monitoring/health
CODE


On success, this returns:

{ "status": "UP"} 
CODE


Logging

Find log file directions for all censhare WP and Keycloak related services.

censhare Server

You can find the logs at:

/var/opt/censer/censhare-server.log
CODE

Cloud Gateway

You can find the logs at:

/opt/log/censer/cloud-gateway.log
CODE

Cloud Gateway detailed logging:

spring.application.log-request-details:   true
logging.level.org.springframework.web:   TRACE
logging.level.org.springframework.web.HttpLogging:   TRACE
CODE

Static Resource Server

You can find the logs at:

/var/log/censer/static-resource-server.log
CODE

Static Resource Server detailed logging:

spring.application.log-request-details: true
logging.level.org.springframework.web: TRACE
logging.level.org.springframework.web.HttpLogging: TRACE
CODE

Keycloak logs

/opt/jboss/keycloak/standalone/logs
 
less /opt/jboss/keycloak/standalone/logs/server.log
CODE

Keycloak all events

By default, Keycloak logs failed authentication attempts. To log all events, add the following to the Keycloak configuration file in the logging section.

Add this logger to the logging subsystem:

/opt/jboss/keycloak/standalone/configuration/standalone.xml

<logger category="org.keycloak.events">
    <level name="DEBUG"/>
</logger>
CODE

Keycloak detailed logging

/opt/jboss/keycloak/standalone/configuration/standalone.xml

<periodic-rotating-file-handler name="FILE" autoflush="true">
    <level name="DEBUG"/>
    <formatter>
        <named-formatter name="PATTERN"/>
    </formatter>
    <file relative-to="jboss.server.log.dir" path="server.log"/>
    <suffix value=".yyyy-MM-dd"/>
    <append value="true"/>
</periodic-rotating-file-handler>
CODE

Authorization mapper logging

For more information, see Authorization mapper.

Optional services logs

If installed, logs for the optional services are in

Google AI

/var/opt/censer/google-ai.log
CODE

Social media management

/var/opt/censer/social-media-service.log
CODE