censhare WP and Keycloak - Monitor and logging
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
systemctl status censhare.*
systemctl status SERVICE_NAME
sudo systemctl start SERVICE_NAME
sudo systemctl restart SERVICE_NAME
sudo systemctl stop SERVICE_NAME
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
On success, this returns:
{ "status": "UP"}
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
Cloud Gateway
You can find the logs at:
/opt/log/censer/cloud-gateway.log
Cloud Gateway detailed logging:
spring.application.log-request-details: true
logging.level.org.springframework.web: TRACE
logging.level.org.springframework.web.HttpLogging: TRACE
Static Resource Server
You can find the logs at:
/var/log/censer/static-resource-server.log
Static Resource Server detailed logging:
spring.application.log-request-details: true
logging.level.org.springframework.web: TRACE
logging.level.org.springframework.web.HttpLogging: TRACE
Keycloak logs
/opt/jboss/keycloak/standalone/logs
less /opt/jboss/keycloak/standalone/logs/server.log
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>
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>
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
Social media management
/var/opt/censer/social-media-service.log