# [RFC] Implement a LoggerInterface to PHP

- Thread: https://externals.io/message/63777
- Original archive: https://news-web.php.net/php.internals/63777
- Started by Florin Razvan Patan on 2012-11-08T11:42:46+00:00
- Messages: 8
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #63777 — Florin Razvan Patan — 2012-11-08T11:42:46+00:00

URL: https://externals.io/message/63777#63777

Hello,


After a talk on the Symfony framework here:
https://github.com/symfony/symfony/issues/5911
Long story short, the point that @Seldaek suggestion to have a common
interface for loggers
actually makes sense and the best way to have it would be to have PHP
include it by default.

I'm not sure exactly what amount of work this implies, nor my C skills
are existent, but with
PHP having such an interface available it would help standardize
things in the PHP world.

Also, I'm not sure if this could be backported into existing PHP 5.3
or PHP 5.4 versions
but this would make sense to consider it for PHP 5.5.

What do you guys think? Could this be considered to be included in PHP?

Thank you for your time.




Best regards,
Florin

----
Florin Patan

---

## #63778 — Patrick ALLAERT — 2012-11-08T13:13:26+00:00

URL: https://externals.io/message/63777#63778 · In reply to: #63777

Hi,

2012/11/8 Florin Razvan Patan <florinpatan@gmail.com>:
> Hello,
>
>
> After a talk on the Symfony framework here:
> https://github.com/symfony/symfony/issues/5911
> Long story short, the point that @Seldaek suggestion to have a common
> interface for loggers
> actually makes sense and the best way to have it would be to have PHP
> include it by default.
>
> I'm not sure exactly what amount of work this implies, nor my C skills
> are existent, but with
> PHP having such an interface available it would help standardize
> things in the PHP world.
>
> Also, I'm not sure if this could be backported into existing PHP 5.3
> or PHP 5.4 versions
> but this would make sense to consider it for PHP 5.5.
>
> What do you guys think? Could this be considered to be included in PHP?

What's the benefit of having this made inside PHP itself?
It's perfectly possible to share a common interface across projects
even if not native to PHP.

It's quite easy to create a PECL extension for that, that would suites
your need regardless of PHP version, but again, I don't really see the
benefit of doing that in C, at the core of PHP.

---

## #63779 — Anthony Ferrara — 2012-11-08T13:20:03+00:00

URL: https://externals.io/message/63777#63779 · In reply to: #63777

Florin,

On Thu, Nov 8, 2012 at 6:42 AM, Florin Razvan Patan
<florinpatan@gmail.com>wrote:

> Hello,
>
>
> After a talk on the Symfony framework here:
> https://github.com/symfony/symfony/issues/5911
> Long story short, the point that @Seldaek suggestion to have a common
> interface for loggers
> actually makes sense and the best way to have it would be to have PHP
> include it by default.
>
> I'm not sure exactly what amount of work this implies, nor my C skills
> are existent, but with
> PHP having such an interface available it would help standardize
> things in the PHP world.
>
> Also, I'm not sure if this could be backported into existing PHP 5.3
> or PHP 5.4 versions
> but this would make sense to consider it for PHP 5.5.
>
> What do you guys think? Could this be considered to be included in PHP?
>
> Thank you for your time.
>
>
>
>
> Best regards,
> Florin
>

Pedantically speaking, isn't this the exact goal of the FIG/PSR group? That
they define these common parts?

Is there an advantage to having it in C (performance, etc)? If so, there
may be something to discuss. But if it's just to enforce a common paradigm,
I'd say leave that to the community to do. They are in a better position
and can change their mind if they need to. Something that core is
reasonably positioned to not do...

Anthony

---

## #63780 — Sebastian Krebs — 2012-11-08T13:38:54+00:00

URL: https://externals.io/message/63777#63780 · In reply to: #63779

2012/11/8 Anthony Ferrara <ircmaxell@gmail.com>

> Florin,
>
> On Thu, Nov 8, 2012 at 6:42 AM, Florin Razvan Patan
> <florinpatan@gmail.com>wrote:
>
> > […]
>
> Pedantically speaking, isn't this the exact goal of the FIG/PSR group? That
> they define these common parts?
>

There are already discussing this (to be honest: For months now).

Some are mentioned at the pull requests at
https://github.com/php-fig/fig-standards/pulls


>
> Is there an advantage to having it in C (performance, etc)? If so, there
> may be something to discuss. But if it's just to enforce a common paradigm,
> I'd say leave that to the community to do. They are in a better position
> and can change their mind if they need to. Something that core is
> reasonably positioned to not do...
>
> Anthony
>



-- 
github.com/KingCrunch

---

## #63783 — Anthony Ferrara — 2012-11-08T14:42:48+00:00

URL: https://externals.io/message/63777#63783 · In reply to: #63780

Sebastian,

There are already discussing this (to be honest: For months now).
>
> Some are mentioned at the pull requests at
> https://github.com/php-fig/fig-standards/pulls


So then there's really no reason to be discussing it for core, is there?

---

## #63787 — Larry Garfield — 2012-11-09T01:30:46+00:00

URL: https://externals.io/message/63777#63787 · In reply to: #63783

> Sebastian,
>
> There are already discussing this (to be honest: For months now).
> > […]
>
> So then there's really no reason to be discussing it for core, is there?

There is not.  This is a task for the FIG group, not Internals.

--Larry Garfield, Drupal rep to the FIG group

---

## #63790 — crankypuss — 2012-11-09T09:32:30+00:00

URL: https://externals.io/message/63777#63790 · In reply to: #63777

> Hello,
>
>
> After a talk on the Symfony framework here:
> https://github.com/symfony/symfony/issues/5911
> Long story short, the point that @Seldaek suggestion to have a common
> interface for loggers
> actually makes sense and the best way to have it would be to have PHP
> include it by default.
>
> I'm not sure exactly what amount of work this implies, nor my C skills
> are existent, but with
> PHP having such an interface available it would help standardize
> things in the PHP world.
>
> Also, I'm not sure if this could be backported into existing PHP 5.3
> or PHP 5.4 versions
> but this would make sense to consider it for PHP 5.5.
>
> What do you guys think? Could this be considered to be included in PHP?
>
> Thank you for your time.
>
>
>
>
> Best regards,
> Florin
>
> ----
> Florin Patan
>

The possibility of opening security holes or otherwise breaking existing 
applications because new functionality has been introduced "by default", 
is such that inclusions of new functionality *by*default* are usually 
Very Bad Luck and should imo always be avoided.

---

## #63792 — Pierre Joye — 2012-11-09T11:38:54+00:00

URL: https://externals.io/message/63777#63792 · In reply to: #63777

hi!

On Thu, Nov 8, 2012 at 12:42 PM, Florin Razvan Patan
<florinpatan@gmail.com> wrote:
> Hello,
>
>
> After a talk on the Symfony framework here:
> https://github.com/symfony/symfony/issues/5911
> Long story short, the point that @Seldaek suggestion to have a common
> interface for loggers
> actually makes sense and the best way to have it would be to have PHP
> include it by default.
>
> I'm not sure exactly what amount of work this implies, nor my C skills
> are existent, but with
> PHP having such an interface available it would help standardize
> things in the PHP world.
>
> Also, I'm not sure if this could be backported into existing PHP 5.3
> or PHP 5.4 versions
> but this would make sense to consider it for PHP 5.5.
>
> What do you guys think? Could this be considered to be included in PHP?
>
> Thank you for your time.


We already had a discussion about having pure interfaces in PHP, as
standard. The idea was rejected. This is the role of the PSR group, or
other similar entities to sit down together to define such things.

Cheers,
--
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
