Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientBuilder::defaultLogger 找不到会报错做了临时方案解决 #130

Open
webyou0 opened this issue Dec 7, 2022 · 0 comments
Open

Comments

@webyou0
Copy link

webyou0 commented Dec 7, 2022

/** * @param ClientBuilder $clientBuilder * @param array $config * @return ClientBuilder */ public static function configureLogging(ClientBuilder $clientBuilder, array $config) { if (Arr::get($config,'logging.enabled')) { try{ // Configure hosts $logger = ClientBuilder::defaultLogger(Arr::get($config,'logging.location'), Arr::get($config,'logging.level','all')); $clientBuilder->setLogger($logger); }catch (\Error $e){ $f = explode('.',Arr::get($config,'logging.location')); $exf = array_pop($f); $logger = new \Monolog\Logger('ES Logs'); $logger->pushHandler(new \Monolog\Handler\StreamHandler(join('.',$f)."-".date('Y-m-d').".".$exf)); $clientBuilder->setLogger($logger); } } return $clientBuilder; }``

@webyou0 webyou0 changed the title ClientBuilder::defaultLogger 找不到会报做做了临时方案解决 ClientBuilder::defaultLogger 找不到会报错做了临时方案解决 Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant