Comments (9)
Is that in debug mode (with exception handling to browser output) or in production mode (log only)?
from cakephp-databaselog.
I cannot reproduce this for both debug and production with the documented approach.
In either way it is logged as expected for e.g.
<?php blaaaa ($tasks as $task) { ?>
as
[ParseError] syntax error, unexpected 'as' (T_AS), expecting ',' or ')
etc
Running on PHP7.1 (I think if you are on 5.6 this is an issue of our error handling in core).
from cakephp-databaselog.
Even on production mode it should log, should it not?
from cakephp-databaselog.
for me php return TypeErrors also do not log to DatabaseLog but log to default file Log.
function foo(string $string): string
{
return null;
}
from cakephp-databaselog.
Could this be the issue of the ErrorHandler? Does stepping through with a debugger yield any more info here?
from cakephp-databaselog.
What PHP version are you using?
And what ErrorHandling setup?
Because in my case it also works there:
[TypeError] Return value of App\...::foo() must be of the type string, null returned
is properly logged to DB
from cakephp-databaselog.
Note that the Cake internal error handler has an issue with internal errors in PHP7.0+:
try {
if (!$rendererClassName) {
throw new Exception("$rendererClassName is an invalid class.");
}
/* @var \Cake\Error\ExceptionRendererInterface $renderer */
$renderer = new $rendererClassName($exception);
$response = $renderer->render();
$this->_clearOutput();
$this->_sendResponse($response);
} catch (Exception $e) {
// Disable trace for internal errors.
$this->_options['trace'] = false;
$message = sprintf(
"[%s] %s\n%s", // Keeping same message format
get_class($e),
$e->getMessage(),
$e->getTraceAsString()
);
trigger_error($message, E_USER_ERROR);
}
The PHP7 throwable catch part is missing here IMO.
And there might be other cases missing in other places.
Refs cakephp/cakephp#9043
from cakephp-databaselog.
Should be fixed with cakephp/cakephp#11462
Can someone confirm that branch of CakePHP together with PHP7 works?
from cakephp-databaselog.
I assume cakephp/cakephp#11462 will make it into 3.5.x branch - if yes, I hope I won't forget to attempt to use this Logger again with the next 3.5.x release and report back on low level errors, such as syntax.
from cakephp-databaselog.
Related Issues (18)
- Add monitor shell command HOT 1
- Fix postgres compatability
- Building a dashboard HOT 1
- Missing route HOT 2
- Duplicate errors being written to the DB table HOT 8
- Unit-Testing doesn't seem to work HOT 2
- use datetime instead of timestamp HOT 1
- Deprecated errors HOT 2
- Fatal error on logging with uploads HOT 7
- Add summary field for paginated filter backend
- Missing Controller Error HOT 4
- DatbaseLogsTable::ensureTables() causes app to crash in environments without test connection HOT 5
- Cake 4.3 Routing deprecation HOT 1
- New release HOT 2
- Three debug messages are produced by the plugin tests HOT 1
- Bad Gateway HOT 2
- working with AuthComponent HOT 3
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 cakephp-databaselog.