Questions tagged [psr-3]

PSR-3 is a common logging interface proposed by the PHP Framework Interop Group. Use this tag for questions about the PSR-3 interface and how to implement it.

Resources:

9 questions
9
votes
1 answer

Opening parenthesis of a multi-line function call must be the last content on the line

I Write this code in my PHP file : public function ScriptsStyles() { wp_enqueue_style( 'fontawesome', plugins_url("/css/font-awesome.css", __FILE__), array(), 'null' ); …
2dar
  • 611
  • 2
  • 9
  • 22
5
votes
1 answer

PSR Log - Why no NULL default value for LoggerAwareInterface and LoggerAwareTrait

According to your sample on Github you inject the logger interface in the constructor with default value of NULL.
Jay
  • 1,035
  • 2
  • 11
  • 22
3
votes
3 answers

Conditionally check suggested package existence in PHP (Composer)

I'm developing a PHP package (distributed on Composer) that could benefit from logging, but doesn't require it. I've seen many sample composer.json files that include suggested packages like so: { "suggest": { "monolog/monolog": "Allows…
Ankur
  • 2,792
  • 3
  • 23
  • 26
1
vote
1 answer

Fatal error: Class 'Psr\Log\AbstractLogger' not found in Logger.php on line 30

I'm getting this error: Fatal error: Class 'Psr\Log\AbstractLogger' not found in /var/www/html/rackspace/vendor/rackspace/php-opencloud/lib/OpenCloud/Common/Log/Logger.php on line 30 This is my Logger.php file
Rishi Kulshreshtha
  • 1,748
  • 1
  • 24
  • 35
1
vote
1 answer

Best way to pass a class into a callback function

I am using a PSR-3 logging class, and I am attempting to use it in conjunction with set_error_handler(). My question is how do I properly "grab" the logging object? Quick Example: My ErrorHandler.php: set_error_handler(function ($errno, $errstr…
A.B. Carroll
  • 2,404
  • 2
  • 17
  • 19
0
votes
0 answers

How to display all Doctrine queries without the deprecated EchoSQLLogger?

I would like to echo all my Doctrine Queries like it was before with the now deprecated EchoSQLLogger. I am running Doctrine under CodeIgniter4. I have tried the following code, using a very basic PSR3 logger (wasinger/simplelogger) but it seems…
b126
  • 544
  • 4
  • 11
0
votes
1 answer

PSR-3 interpolation

I am wondering what the exact use it for the interpolate function when you have a PSR-3 logger. I know how it works by looking at this reference: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#12-message But…
Stephan-v
  • 19,255
  • 31
  • 115
  • 201
0
votes
1 answer

Best way to access a logger across an application/website in PHP

I've recently read up on PSR-3 and am interested in learning about the best way(s) of approaching a logger implementation across a web application or website. I understand how a logger is defined and how they can be implemented per PSR-3, but what…
reformed
  • 4,505
  • 11
  • 62
  • 88
0
votes
1 answer

Log lines formatting

I have a problem with implementation of logging system based on PSR-3 standards (and interfaces/classes delivered with it - https://github.com/php-fig/log). I have created some classes extending PSR-3: logger, which uses adapters to do actual…