Skip to content

Commit 3007c2c

Browse files
authored
Merge pull request #40 from moveis-simonetti/improv/ignore-exceptions-nr
(improv): add possibilidade de ignorar exceptions no NR
2 parents e9f68cc + d6525b6 commit 3007c2c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ ENV \
66
NR_APP_NAME="" \
77
NR_LICENSE_KEY="" \
88
NR_VERSION="" \
9+
NR_IGNORE_DEFAULT_EXCEPTION=false \
10+
NR_IGNORED_EXECEPTIONS="" \
911
PHP_OPCACHE_ENABLED=false \
1012
SESSION_HANDLER=false \
1113
SESSION_HANDLER_NAME="" \

bin/newrelic-setup

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ if [[ ${NR_ENABLED} == true ]]; then
1313
echo "newrelic.application_logging.enabled = true" | tee -a /usr/local/etc/php/conf.d/newrelic.ini
1414
fi
1515

16+
if [[ ${NR_IGNORE_DEFAULT_EXCEPTION} == true ]]; then
17+
NR_DEFAULT_IGNORED_EXCEPTIONS="Simonetti\Infra\Exceptions\IgnorableExceptionInterface"
18+
if [[ "${NR_IGNORED_EXECEPTIONS}" != "" ]]; then
19+
NR_IGNORED_EXCEPTIONS="${NR_DEFAULT_IGNORED_EXCEPTIONS},${NR_IGNORED_EXECEPTIONS}"
20+
else
21+
NR_IGNORED_EXCEPTIONS="${NR_DEFAULT_IGNORED_EXCEPTIONS}"
22+
fi
23+
fi
24+
25+
if [[ "${NR_IGNORED_EXECEPTIONS}" != "" ]]; then
26+
echo "newrelic.error_collector.ignore_exceptions = ${NR_IGNORED_EXECEPTIONS}" | tee -a /usr/local/etc/php/conf.d/newrelic.ini
27+
fi
28+
1629
else
1730
echo "newrelic.enabled = false" | tee -a /usr/local/etc/php/conf.d/newrelic.ini
1831
fi

0 commit comments

Comments
 (0)