Skip to content

Commit

Permalink
update monolog example (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
weslenteche authored Jan 28, 2024
1 parent 8f65b2e commit 0abff5e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function test_request_response(): void
$span = $this->storage[1];
$this->assertSame('GET', $span->getName());
}

public function test_cache_log_db(): void
{
$this->router()->get('/hello', function () {
Expand Down
6 changes: 3 additions & 3 deletions src/Logs/Monolog/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"prefer-stable": true,
"require": {
"monolog/monolog": "^1.1|^2|^3",
"open-telemetry/api": "^1.0.0beta16"
"open-telemetry/api": "^1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -22,8 +22,8 @@
"google/protobuf": ">=3.5.0",
"guzzlehttp/guzzle": "^7.4",
"nyholm/psr7": "^1.6",
"open-telemetry/exporter-otlp": ">=1.0.0beta6",
"open-telemetry/sdk": ">=1.0.0beta7",
"open-telemetry/exporter-otlp": ">=1.0",
"open-telemetry/sdk": ">=1.0",
"phan/phan": "^5.0",
"phpbench/phpbench": "^1.2",
"phpstan/phpstan": "^1.1",
Expand Down
4 changes: 2 additions & 2 deletions src/Logs/Monolog/example/manual-sdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
use OpenTelemetry\SDK\Common\Time\ClockFactory;
use OpenTelemetry\SDK\Logs\Exporter\ConsoleExporter;
use OpenTelemetry\SDK\Logs\LoggerProvider;
use OpenTelemetry\SDK\Logs\Processor\BatchLogsProcessor;
use OpenTelemetry\SDK\Logs\Processor\BatchLogRecordProcessor;
use Psr\Log\LogLevel;

require dirname(__DIR__) . '/vendor/autoload.php';

$loggerProvider = new LoggerProvider(
new BatchLogsProcessor(
new BatchLogRecordProcessor(
new ConsoleExporter((new StreamTransportFactory())->create('php://stdout', 'text')),
ClockFactory::getDefault()
),
Expand Down
4 changes: 2 additions & 2 deletions src/Logs/Monolog/example/multiple-channels.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScopeFactory;
use OpenTelemetry\SDK\Common\Time\ClockFactory;
use OpenTelemetry\SDK\Logs\LoggerProvider;
use OpenTelemetry\SDK\Logs\Processor\BatchLogsProcessor;
use OpenTelemetry\SDK\Logs\Processor\BatchLogRecordProcessor;
use Psr\Log\LogLevel;

require dirname(__DIR__) . '/vendor/autoload.php';
Expand All @@ -21,7 +21,7 @@
*/

$loggerProvider = new LoggerProvider(
new BatchLogsProcessor(
new BatchLogRecordProcessor(
new LogsExporter((new StreamTransportFactory())->create('php://stdout', 'application/json')),
ClockFactory::getDefault()
),
Expand Down

0 comments on commit 0abff5e

Please sign in to comment.