Skip to content

Commit c4a3084

Browse files
committed
tests
1 parent 7494f08 commit c4a3084

File tree

6 files changed

+14
-0
lines changed

6 files changed

+14
-0
lines changed

src/DependencyInjection/SentryExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ private function registerConfiguration(ContainerBuilder $container, array $confi
124124
$options['before_send_metrics'] = new Reference($options['before_send_metrics']);
125125
}
126126

127+
if (isset($options['before_send_logs'])) {
128+
$options['before_send_logs'] = new Reference($options['before_send_logs']);
129+
}
130+
127131
if (isset($options['before_breadcrumb'])) {
128132
$options['before_breadcrumb'] = new Reference($options['before_breadcrumb']);
129133
}

src/Resources/config/schema/sentry-1.0.xsd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<xsd:attribute name="default-integrations" type="xsd:boolean" />
3838
<xsd:attribute name="sample-rate" type="xsd:float" />
3939
<xsd:attribute name="enable-tracing" type="xsd:boolean" />
40+
<xsd:attribute name="enable-logs" type="xsd:boolean" />
4041
<xsd:attribute name="traces-sample-rate" type="xsd:float" />
4142
<xsd:attribute name="profiles-sample-rate" type="xsd:float" />
4243
<xsd:attribute name="traces-sampler" type="xsd:string" />
@@ -54,6 +55,7 @@
5455
<xsd:attribute name="before-send-transaction" type="xsd:string" />
5556
<xsd:attribute name="before-send-check-in" type="xsd:string" />
5657
<xsd:attribute name="before-send-metrics" type="xsd:string" />
58+
<xsd:attribute name="before-send-logs" type="xsd:string" />
5759
<xsd:attribute name="error-types" type="xsd:string" />
5860
<xsd:attribute name="max-breadcrumbs" type="xsd:integer" />
5961
<xsd:attribute name="before-breadcrumb" type="xsd:string" />

tests/DependencyInjection/Fixtures/php/full.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
'traces_sample_rate' => 1,
1818
'traces_sampler' => 'App\\Sentry\\Tracing\\TracesSampler',
1919
'profiles_sample_rate' => 1,
20+
'enable_logs' => true,
2021
'attach_stacktrace' => true,
2122
'attach_metric_code_locations' => true,
2223
'context_lines' => 0,
@@ -32,6 +33,7 @@
3233
'before_send_transaction' => 'App\\Sentry\\BeforeSendTransactionCallback',
3334
'before_send_check_in' => 'App\\Sentry\\BeforeSendCheckInCallback',
3435
'before_send_metrics' => 'App\\Sentry\\BeforeSendMetricsCallback',
36+
'before_send_logs' => 'App\\Sentry\\BeforeSendLogsCallback',
3537
'trace_propagation_targets' => ['website.invalid'],
3638
'tags' => [
3739
'context' => 'development',

tests/DependencyInjection/Fixtures/xml/full.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<sentry:options default-integrations="false"
1414
sample-rate="1"
1515
enable-tracing="true"
16+
enable-logs="true"
1617
traces-sample-rate="1"
1718
traces-sampler="App\Sentry\Tracing\TracesSampler"
1819
profiles-sample-rate="1"
@@ -29,6 +30,7 @@
2930
before-send-transaction="App\Sentry\BeforeSendTransactionCallback"
3031
before-send-check-in="App\Sentry\BeforeSendCheckInCallback"
3132
before-send-metrics="App\Sentry\BeforeSendMetricsCallback"
33+
before-send-logs="App\Sentry\BeforeSendLogsCallback"
3234
error-types="E_ALL"
3335
max-breadcrumbs="1"
3436
before-breadcrumb="App\Sentry\BeforeBreadcrumbCallback"

tests/DependencyInjection/Fixtures/yml/full.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ sentry:
1212
traces_sample_rate: 1
1313
traces_sampler: App\Sentry\Tracing\TracesSampler
1414
profiles_sample_rate: 1
15+
enable_logs: true
1516
attach_stacktrace: true
1617
attach_metric_code_locations: true
1718
context_lines: 0
@@ -29,6 +30,7 @@ sentry:
2930
before_send_transaction: App\Sentry\BeforeSendTransactionCallback
3031
before_send_check_in: App\Sentry\BeforeSendCheckInCallback
3132
before_send_metrics: App\Sentry\BeforeSendMetricsCallback
33+
before_send_logs: App\Sentry\BeforeSendLogsCallback
3234
trace_propagation_targets:
3335
- 'website.invalid'
3436
tags:

tests/DependencyInjection/SentryExtensionTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ public function testClientIsCreatedFromOptions(): void
209209
'traces_sample_rate' => 1,
210210
'traces_sampler' => new Reference('App\\Sentry\\Tracing\\TracesSampler'),
211211
'profiles_sample_rate' => 1,
212+
'enable_logs' => true,
212213
'attach_stacktrace' => true,
213214
'attach_metric_code_locations' => true,
214215
'context_lines' => 0,
@@ -228,6 +229,7 @@ public function testClientIsCreatedFromOptions(): void
228229
'before_send_transaction' => new Reference('App\\Sentry\\BeforeSendTransactionCallback'),
229230
'before_send_check_in' => new Reference('App\\Sentry\\BeforeSendCheckInCallback'),
230231
'before_send_metrics' => new Reference('App\\Sentry\\BeforeSendMetricsCallback'),
232+
'before_send_logs' => new Reference('App\\Sentry\\BeforeSendLogsCallback'),
231233
'trace_propagation_targets' => ['website.invalid'],
232234
'tags' => [
233235
'context' => 'development',

0 commit comments

Comments
 (0)