Skip to content

Commit

Permalink
Merge pull request #846 from uselagoon/nr-applog
Browse files Browse the repository at this point in the history
add New Relic Application Logging variables
  • Loading branch information
tobybellwood authored Oct 12, 2023
2 parents 796181a + a9a0212 commit 31af2be
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions helpers/TESTING_base_images_dockercompose.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ docker-compose exec -T commons sh -c "curl -kL http://php-8-0-dev:9000" | grep "
docker-compose exec -T commons sh -c "curl -kL http://php-8-0-dev:9000" | grep "xdebug.log" | grep "/tmp/xdebug.log"
docker-compose exec -T commons sh -c "curl -kL http://php-8-0-dev:9000" | grep "newrelic.appname" | grep "noproject-nobranch"
docker-compose exec -T commons sh -c "curl -kL http://php-8-0-dev:9000" | grep "newrelic.logfile" | grep "/dev/stderr"
docker-compose exec -T commons sh -c "curl -kL http://php-8-0-dev:9000" | grep "newrelic.application_logging.metrics.enabled" | grep "disabled"
docker-compose exec -T commons sh -c "curl -kL http://php-8-0-dev:9000" | grep "Blackfire" | grep "enabled"
docker-compose exec -T commons sh -c "curl -kL http://php-8-0-dev:9000" | grep "blackfire.agent_socket" | grep "tcp://127.0.0.1:8307"

Expand Down Expand Up @@ -128,6 +129,7 @@ docker-compose exec -T commons sh -c "curl -kL http://php-8-1-dev:9000" | grep "
docker-compose exec -T commons sh -c "curl -kL http://php-8-1-dev:9000" | grep "xdebug.log" | grep "/tmp/xdebug.log"
docker-compose exec -T commons sh -c "curl -kL http://php-8-1-dev:9000" | grep "newrelic.appname" | grep "noproject-nobranch"
docker-compose exec -T commons sh -c "curl -kL http://php-8-1-dev:9000" | grep "newrelic.logfile" | grep "/dev/stderr"
docker-compose exec -T commons sh -c "curl -kL http://php-8-1-dev:9000" | grep "newrelic.application_logging.forwarding.enabled" | grep "disabled"
docker-compose exec -T commons sh -c "curl -kL http://php-8-1-dev:9000" | grep "Blackfire" | grep "enabled"
docker-compose exec -T commons sh -c "curl -kL http://php-8-1-dev:9000" | grep "blackfire.agent_socket" | grep "tcp://127.0.0.1:8307"

Expand Down Expand Up @@ -168,6 +170,7 @@ docker-compose exec -T commons sh -c "curl -kL http://php-8-2-dev:9000" | grep "
docker-compose exec -T commons sh -c "curl -kL http://php-8-2-dev:9000" | grep "PHP_IDE_CONFIG" | grep "serverName=lagoon"
docker-compose exec -T commons sh -c "curl -kL http://php-8-2-dev:9000" | grep "xdebug.log" | grep "/tmp/xdebug.log"
docker-compose exec -T commons sh -c "curl -kL http://php-8-2-dev:9000" | grep "newrelic.appname" | grep "noproject-nobranch"
docker-compose exec -T commons sh -c "curl -kL http://php-8-2-dev:9000" | grep "newrelic.application_logging.enabled" | grep "disabled"
docker-compose exec -T commons sh -c "curl -kL http://php-8-2-dev:9000" | grep "newrelic.logfile" | grep "/dev/stderr"
docker-compose exec -T commons sh -c "curl -kL http://php-8-2-dev:9000" | grep "Blackfire" | grep "enabled"
docker-compose exec -T commons sh -c "curl -kL http://php-8-2-dev:9000" | grep "blackfire.agent_socket" | grep "tcp://127.0.0.1:8307"
Expand Down
3 changes: 3 additions & 0 deletions helpers/images-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ services:
- XDEBUG_LOG=true
- NEWRELIC_ENABLED=true
- BLACKFIRE_ENABLED=true
- NEWRELIC_APPLICATION_LOGGING_METRICS_ENABLED=false
<< : *default-user # uses the defined user from top
command: ["sh", "-c", "
echo PD9waHAKCnBocGluZm8oICk7Cgo/Pg== | base64 -d > /app/index.php;
Expand Down Expand Up @@ -85,6 +86,7 @@ services:
- XDEBUG_LOG=true
- NEWRELIC_ENABLED=true
- BLACKFIRE_ENABLED=true
- NEWRELIC_APPLICATION_LOGGING_FORWARDING_ENABLED=false
<< : *default-user # uses the defined user from top
command: ["sh", "-c", "
echo PD9waHAKCnBocGluZm8oICk7Cgo/Pg== | base64 -d > /app/index.php;
Expand Down Expand Up @@ -117,6 +119,7 @@ services:
- XDEBUG_LOG=true
- NEWRELIC_ENABLED=true
- BLACKFIRE_ENABLED=true
- NEWRELIC_APPLICATION_LOGGING_ENABLED=false
<< : *default-user # uses the defined user from top
command: ["sh", "-c", "
echo PD9waHAKCnBocGluZm8oICk7Cgo/Pg== | base64 -d > /app/index.php;
Expand Down
3 changes: 3 additions & 0 deletions images/php-fpm/8.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ RUN architecture=$(case $(uname -m) in x86_64 | amd64) echo "amd64" ;; aarch64 |
&& sed -i -e "s/;newrelic.daemon.loglevel = .*/newrelic.daemon.loglevel = \"\${NEWRELIC_DAEMON_LOG_LEVEL:-warning}\"/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/newrelic.logfile = .*/newrelic.logfile = \"\/dev\/stderr\"/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/newrelic.daemon.logfile = .*/newrelic.daemon.logfile = \"\/dev\/stderr\"/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/;newrelic.application_logging.enabled = .*/newrelic.application_logging.enabled = \${NEWRELIC_APPLICATION_LOGGING_ENABLED:-true}/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/;newrelic.application_logging.metrics.enabled = .*/newrelic.application_logging.metrics.enabled = \${NEWRELIC_APPLICATION_LOGGING_METRICS_ENABLED:-true}/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/;newrelic.application_logging.forwarding.enabled = .*/newrelic.application_logging.forwarding.enabled = \${NEWRELIC_APPLICATION_LOGGING_FORWARDING_ENABLED:-true}/" /usr/local/etc/php/conf.d/newrelic.ini \
&& mv /usr/local/etc/php/conf.d/newrelic.ini /usr/local/etc/php/conf.d/newrelic.disable \
&& cd / && rm -rf /tmp/newrelic \
&& fix-permissions /usr/local/etc/; \
Expand Down
3 changes: 3 additions & 0 deletions images/php-fpm/8.1.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ RUN architecture=$(case $(uname -m) in x86_64 | amd64) echo "amd64" ;; aarch64 |
&& sed -i -e "s/;newrelic.daemon.loglevel = .*/newrelic.daemon.loglevel = \"\${NEWRELIC_DAEMON_LOG_LEVEL:-warning}\"/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/newrelic.logfile = .*/newrelic.logfile = \"\/dev\/stderr\"/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/newrelic.daemon.logfile = .*/newrelic.daemon.logfile = \"\/dev\/stderr\"/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/;newrelic.application_logging.enabled = .*/newrelic.application_logging.enabled = \${NEWRELIC_APPLICATION_LOGGING_ENABLED:-true}/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/;newrelic.application_logging.metrics.enabled = .*/newrelic.application_logging.metrics.enabled = \${NEWRELIC_APPLICATION_LOGGING_METRICS_ENABLED:-true}/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/;newrelic.application_logging.forwarding.enabled = .*/newrelic.application_logging.forwarding.enabled = \${NEWRELIC_APPLICATION_LOGGING_FORWARDING_ENABLED:-true}/" /usr/local/etc/php/conf.d/newrelic.ini \
&& mv /usr/local/etc/php/conf.d/newrelic.ini /usr/local/etc/php/conf.d/newrelic.disable \
&& cd / && rm -rf /tmp/newrelic \
&& fix-permissions /usr/local/etc/; \
Expand Down
3 changes: 3 additions & 0 deletions images/php-fpm/8.2.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ RUN architecture=$(case $(uname -m) in x86_64 | amd64) echo "amd64" ;; aarch64 |
&& sed -i -e "s/;newrelic.daemon.loglevel = .*/newrelic.daemon.loglevel = \"\${NEWRELIC_DAEMON_LOG_LEVEL:-warning}\"/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/newrelic.logfile = .*/newrelic.logfile = \"\/dev\/stderr\"/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/newrelic.daemon.logfile = .*/newrelic.daemon.logfile = \"\/dev\/stderr\"/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/;newrelic.application_logging.enabled = .*/newrelic.application_logging.enabled = \${NEWRELIC_APPLICATION_LOGGING_ENABLED:-true}/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/;newrelic.application_logging.metrics.enabled = .*/newrelic.application_logging.metrics.enabled = \${NEWRELIC_APPLICATION_LOGGING_METRICS_ENABLED:-true}/" /usr/local/etc/php/conf.d/newrelic.ini \
&& sed -i -e "s/;newrelic.application_logging.forwarding.enabled = .*/newrelic.application_logging.forwarding.enabled = \${NEWRELIC_APPLICATION_LOGGING_FORWARDING_ENABLED:-true}/" /usr/local/etc/php/conf.d/newrelic.ini \
&& mv /usr/local/etc/php/conf.d/newrelic.ini /usr/local/etc/php/conf.d/newrelic.disable \
&& cd / && rm -rf /tmp/newrelic \
&& fix-permissions /usr/local/etc/; \
Expand Down

0 comments on commit 31af2be

Please sign in to comment.