sc0ttkclark / papertrail Goto Github PK
View Code? Open in Web Editor NEWPapertrail Logging API for WordPress
License: GNU General Public License v3.0
Papertrail Logging API for WordPress
License: GNU General Public License v3.0
When upgrading my server from 7.4 to PHP 8.0, I encountered this (slightly edited)
Fatal error: Uncaught ArgumentCountError: Too few arguments to function WP_Papertrail_API::error_handler(), 4 passed and exactly 5 expected in /nas/content/live/ccc/WP_Papertrail_API.php:194
I replaced, in WP_Papertrails_API.php
,
this
public static function error_handler( $id, $message, $file, $line, $context )
with
public static function error_handler( $id, $message, $file, $line ) {
Seems to work, but I'm not confident enough in this solution to post a Pull Request.
See also: //https://stackoverflow.com/questions/65201307/too-few-arguments-to-function-exception-error-handler-php8
Thanks for putting this together!
More a question than anything else, just to check whether I'm barking up the wrong tree, if I wanted to send all PHP errors to Papertrail (and can't use the usual remote_syslog option because it's shared hosting), I would imagine I could use set_error_handler()
and send errors through to WP_Papertrail_API::log()
... right?
Would you suggest doing this any differently?
At a higher load, calling socket_create( AF_INET, SOCK_DGRAM, SOL_UDP )
for each log message will become expensive.
It would perform better to only create one socket (in a constructor, for instance) and reuse it for all log calls.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.