Skip to content

Commit

Permalink
Enable syslog logging for psama Docker container (#148)
Browse files Browse the repository at this point in the history
* Enable syslog logging for psama Docker container

Added syslog logging configuration to the psama Docker run command, specifying 'wildfly' as the log tag. Updated the Splunk configuration and created a new log directory for psama logs to improve logging and monitoring capabilities.

* Add logging directories for Psama Docker
  • Loading branch information
Gcolon021 authored Jul 29, 2024
1 parent 9c28873 commit d7906f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app-infrastructure/scripts/psama-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ sudo docker stop psama || true
sudo docker rm psama || true
sudo docker run -u root --name=psama --restart always --network=picsure \
--env-file /home/centos/psama.env \
-v /var/log/psama-docker-os-logs/:/var/log/ \
-v /var/log/psama-docker-logs/:/opt/psama/logs/ \
-e JAVA_OPTS="$PSAMA_OPTS" \
--log-driver syslog --log-opt tag=wildfly \
-v /home/centos/fence_mapping.json:/config/fence_mapping.json \
-p 8090:8090 \
-d $PSAMA_IMAGE
12 changes: 11 additions & 1 deletion app-infrastructure/scripts/wildfly-user_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ index=hms_aws_${gss_prefix}
sourcetype = hms_app_logs
source = wildfly_logs
index=hms_aws_${gss_prefix}
[monitor:///var/log/psama-docker-logs]
sourcetype = hms_app_logs
source = wildfly_logs
index=hms_aws_${gss_prefix}
[monitor:///var/log/psama-docker-os-logs]
sourcetype = hms_app_logs
source = wildfly_logs
index=hms_aws_${gss_prefix}
" | sudo tee -a /opt/splunkforwarder/etc/system/local/inputs.conf
/opt/splunkforwarder/bin/splunk enable boot-start -systemd-managed 1 -user splunk && sudo systemctl restart SplunkForwarder || true

Expand All @@ -33,7 +43,7 @@ sleep 300

# make picsure network
sudo docker network create picsure
sudo mkdir /var/log/{wildfly-docker-logs,wildfly-docker-os-logs}
sudo mkdir /var/log/{wildfly-docker-logs,wildfly-docker-os-logs,psama-docker-logs,psama-docker-os-logs}

# Download the wildfly and psama docker scripts
s3_copy s3://${stack_s3_bucket}/configs/jenkins_pipeline_build_${stack_githash}/wildfly-docker.sh /home/centos/wildfly-docker.sh
Expand Down

0 comments on commit d7906f3

Please sign in to comment.