Comments (4)
sorry i make a mistake about name of my file xxxx.yaml whereas the extension was xxx.yml
so your test file_exists doesn't work ... i should put it in my code :
try {
$path = APPLICATION_PATH . '/configs/monolog/cascade/testcontroller.yml';
//echo $path."\n";
if (!file_exists($path)) {
throw new Exception('file not exists : '.$path);
}
Cascade::fileConfig($path);
Cascade::getLogger('myApp')->info('Well, that works!');
Cascade::getLogger('myApp')->error('Maybe not...');
} catch (Exception $e) {
echo $e;
}
from monolog-cascade.
So, I'm not sure I follow. Do you need any help?
from monolog-cascade.
@rantonmattei he says that your Cascade::fileConfig($path);
does not check that file does not exist and proceeds with uncertain error message that does not give any hint what was wrong.
from monolog-cascade.
run this example:
<?php
use Cascade\Cascade;
require 'vendor/autoload.php';
Cascade::fileConfig('no-such-file-anywhere');
and you get:
$ php test.php
PHP Warning: Illegal string offset 'disable_existing_loggers' in monolog-cascade/src/Config.php on line 99
PHP Stack trace:
PHP 1. {main}() monolog-cascade/test.php:0
PHP 2. Cascade\Cascade::fileConfig() monolog-cascade/test.php:7
PHP 3. Cascade\Config->configure() monolog-cascade/src/Cascade.php:112
PHP Warning: Illegal string offset 'disable_existing_loggers' in monolog-cascade/src/Config.php on line 102
PHP Stack trace:
PHP 1. {main}() monolog-cascade/test.php:0
PHP 2. Cascade\Cascade::fileConfig() monolog-cascade/test.php:7
PHP 3. Cascade\Config->configure() monolog-cascade/src/Cascade.php:112
PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Cannot configure loggers. No logger configuration options provided.' in monolog-cascade/src/Config.php:121
Stack trace:
#0 monolog-cascade/src/Cascade.php(112): Cascade\Config->configure()
#1 monolog-cascade/test.php(7): Cascade\Cascade::fileConfig('no-such-file-an...')
#2 {main}
thrown in monolog-cascade/src/Config.php on line 121
from monolog-cascade.
Related Issues (20)
- PHP 8 compatibility HOT 4
- Update to PHPUnit9.X to resolve PHP8 dev-dependency chain
- Release 0.6 pre-release with tag name that makes Composer happy HOT 1
- Support for monolog 3.5
- support for 'extends' on loggers HOT 2
- Log Rotate HOT 2
- "array" missing as possible param type in Cascade::fileConfig HOT 1
- Add default logger HOT 2
- there is a typo
- File permissions on handler HOT 1
- Namespaced logger configuration HOT 4
- Getting the streamhandler URL(s) HOT 2
- YAML config file ignored HOT 3
- Rollbar configuration example
- monolog-cascade doesn't create log folders and file HOT 2
- Public property with uppercase at the beginning ends with error
- Support for monolog "^2.0"? HOT 8
- PHP 7.4 deprecations HOT 2
- GitHub -> Packagist sync has failed HOT 1
- Provide functionality `Cascade::hasLogger()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monolog-cascade.