Skip to content

Commit

Permalink
Better logging for COmanage Registry component
Browse files Browse the repository at this point in the history
Removed the Dockerfile instruction that edited bootstrap.php and swapped
in ConsoleLog for FileLog. Instead the FileLog will remain but now the
entry point script sets up pipes instead of those log files and then
spawns child processes that use cat and awk to format the log entries as
specified for TIER packaged components.
  • Loading branch information
skoranda committed May 3, 2018
1 parent 70ebe1f commit 5b72e59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions comanage-registry-internet2-tier/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ RUN mkdir -p "${COMANAGE_REGISTRY_DIR}" \
&& cd /var/www/html \
&& ln -s ${COMANAGE_REGISTRY_DIR}/app/webroot registry \
&& rm -rf ${COMANAGE_REGISTRY_DIR}/local/* \
&& ln -s ${COMANAGE_REGISTRY_DIR}/local /local \
&& sed -ie 's/'"'"'engine'"'"' => '"'"'FileLog'"'"'/'"'"'engine'"'"' => '"'"'ConsoleLog'"'"'/' "$COMANAGE_REGISTRY_DIR/app/Config/bootstrap.php"
&& ln -s ${COMANAGE_REGISTRY_DIR}/local /local

COPY 000-comanage.conf /etc/httpd/conf.d/
COPY 10-php7.conf /etc/httpd/conf.modules.d/
Expand Down
9 changes: 9 additions & 0 deletions comanage-registry-internet2-tier/docker-comanage-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,13 @@ fi
# Configure Apache HTTP Server with the server name.
sed -i -e s@%%SERVER_NAME%%@"${SERVER_NAME:-unknown}"@g /etc/httpd/conf.d/000-comanage.conf

# Create pipes to use for COmanage Registry instead of standard log files.
mkfifo -m 666 /srv/comanage-registry/app/tmp/logs/error.log
mkfifo -m 666 /srv/comanage-registry/app/tmp/logs/debug.log

# Format any output from COmanange Registry into standard TIER form.
(cat <> /srv/comanage-registry/app/tmp/logs/error.log | awk -v ENV="$ENV" -v UT="$USERTOKEN" '{printf "COmanage Registry error.log %s %s %s\n", ENV, UT, $0; fflush()}' 1>/dev/stdout)&
(cat <> /srv/comanage-registry/app/tmp/logs/debug.log | awk -v ENV="$ENV" -v UT="$USERTOKEN" '{printf "COmanage Registry debug.log %s %s %s\n", ENV, UT, $0; fflush()}' 1>/dev/stdout)&

# Start Apache HTTP Server
exec /usr/sbin/httpd -DFOREGROUND

0 comments on commit 5b72e59

Please sign in to comment.