Skip to content

Commit 3c1a6bc

Browse files
committed
fixed setting of logger
2 parents bfdf8dc + 687d8ce commit 3c1a6bc

File tree

10 files changed

+15
-11
lines changed

10 files changed

+15
-11
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ script:
3838
- php ./demo/cron/\[every\]binlog_collect_worker.php
3939
- php ./demo/cron/\[every\]binlog_collect_worker.php
4040
- php ./demo/cron/\[every\]binlog_collect_worker.php
41-
- vendor/bin/phpunit tests
41+
- cd tests
42+
- ../vendor/bin/phpunit

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.0.3] - 2018-01-02
8+
9+
### Fixed
10+
- fix setting of logger
11+
- pass all test
12+
713
## [1.0.2] - 2018-01-02
814

915
### Added

demo/cron/[1h]binlog_history_gtid_updater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
die();
1414
}
1515
$env_config = BinlogEnvConfig::importDefaultConfig();
16-
$exception_handler = new DefaultSentryExceptionHandler('/var/log/ridi/', 'binlog_history_gtid_updater', $env_config);
16+
$exception_handler = new DefaultSentryExceptionHandler('./', 'binlog_history_gtid_updater', $env_config);
1717
$configuration = BinlogConfiguration::newInstance($argv, $env_config, $exception_handler);
1818

1919
$application = new BinlogHistoryGtidUpdaterApplication($configuration);

demo/cron/[every]binlog_collect_partitioner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
die();
1616
}
1717
$env_config = BinlogEnvConfig::importDefaultConfig();
18-
$exception_handler = new DefaultSentryExceptionHandler('/var/log/ridi/', 'binlog_collector', $env_config);
18+
$exception_handler = new DefaultSentryExceptionHandler('./', 'binlog_collector', $env_config);
1919
$configuration = BinlogConfiguration::newInstance($argv, $env_config, $exception_handler);
2020

2121
$function = function () use ($configuration) {

demo/cron/[every]binlog_collect_worker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
);
2626

2727
$env_config->validateTarget();
28-
$exception_handler = new DefaultSentryExceptionHandler('/var/log/ridi/', 'binlog_collector', $env_config);
28+
$exception_handler = new DefaultSentryExceptionHandler('./', 'binlog_collector', $env_config);
2929
$configuration = BinlogConfiguration::newInstance($argv, $env_config, $exception_handler);
3030

3131
$function = function () use ($configuration) {

demo/cron/binlog_collect_info.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
'jump_offset_for_next_partition' => 1000
1919
]
2020
);
21-
$exception_handler = new DefaultSentryExceptionHandler('/var/log/ridi/', 'binlog_collector', $env_config);
21+
$exception_handler = new DefaultSentryExceptionHandler('./', 'binlog_collector', $env_config);
2222
$configuration = BinlogConfiguration::newInstance($argv, $env_config, $exception_handler);
2323

2424
$application = new BinlogCollectorApplication($configuration);

demo/include/.env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ENABLE_SENTRY = false
2-
#SENTRY_KEY =
2+
SENTRY_KEY =
33

44
TARGET_DB_HOST = 127.0.0.1
55
TARGET_DB_USER = repl

src/Binlog/Collector/External/Impl/DefaultSentryExceptionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class DefaultSentryExceptionHandler implements ExceptionHandlerInterface
2323

2424
public function __construct(string $dir, string $name, BinlogEnvConfig $binlog_env_config)
2525
{
26-
$this->logger = self::createLogger('/var/log/ridi/', 'binlog_collector');
26+
$this->logger = self::createLogger($dir, $name);
2727
if ($binlog_env_config->enable_sentry) {
2828
self::enableSentry($binlog_env_config->sentry_key);
2929
}

tests/Binlog/Utils/BinlogConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function testCreateConnectConfigWithReplace()
2020
new DefaultRowEventValueSkipper($tables_only, $databases_only)
2121
);
2222
$exception_handler = new DefaultSentryExceptionHandler(
23-
'/var/log/ridi/', 'binlog_collector', $binlog_env_config
23+
'./', 'binlog_collector', $binlog_env_config
2424
);
2525

2626
$binlog_configuration = BinlogConfiguration::newInstanceForOnce([], $binlog_env_config, $exception_handler);

tests/bootstrap.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22

33
require 'config.test.php';
44

5-
$autoloader = require_once __DIR__ . '/../vendor/autoload.php';
6-
7-

0 commit comments

Comments
 (0)