[RFC] logger/logging

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
Post Reply
Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 297
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

[RFC] logger/logging

Post by Nicofuma » Sun Jan 18, 2015 7:02 pm

Ticket: PHPBB3-13714
PR:
--------------------

Current state

Currently we use a logger which i completely bound to phpBB, which leads to a few issue:
  • It's completely incompatible with third party
  • It's not really extensible
but it also has some nice features like:
  • the ability to filter the log
  • the ability to give limited access to the logs depending on the acl system.
there is also some other feature that, I think, shouldn't exists like:
  • The ability to delete all or part of the logs, I think that it should be done by a cron job and nothing else (ie: just automatic purge) or at least with a special admin permission
Proposal
  1. Our logger must be PSR3 compatible
  2. Use an interface to be able to change the logger
  3. Use Monolog if available and backport the Symfony Monolog Bridge and Bundle (their integration is pretty good: they use Monolog and its features if available, but their still able to use any logger which implements their interface without having to change anything else than the definition of the logger service)
  4. Use a custom handler to store some entries (or all of them I don't know?) in the database (mainly what is currently logged) and so keep our abilities to display and filter the logs
  5. Improve the current UI to add the severity
  6. Write all the logs in a file and rotate them (ie: one file per day) by default, they will be written in the board default language
  7. Use the DI and a config file (DI extension) to manage all the configuration, so the board admin will be completely able to configure the logging
  8. Add a viewer for the log files in the acp?
Member of the phpBB Development-Team
No Support via PM

User avatar
rfdy
Registered User
Posts: 45
Joined: Wed Apr 16, 2014 2:28 pm

Re: [RFC] logger/logging

Post by rfdy » Mon Jan 19, 2015 6:21 pm

We're also interested in this feature. Currently our extensions add entries to the log, but displaying the data back is difficult without events being triggered to alter the display row.

Ideally there would be a mechanism for extensions to define new log types and attach handlers for displaying/managing them.

User avatar
Pony99CA
Registered User
Posts: 986
Joined: Sun Feb 08, 2009 2:35 am
Location: Hollister, CA
Contact:

Re: [RFC] logger/logging

Post by Pony99CA » Wed Jan 21, 2015 3:15 am

While improved logging would be great, I have no idea what "PSR3" or "DI" mean.

The admin should also be able to turn on or off other items to log (specifically user logins/logouts and guest visits, but possibly other items).

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.

Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 297
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

Re: [RFC] logger/logging

Post by Nicofuma » Wed Jan 21, 2015 7:44 am

DI means Dependency Injection, and PSR3 is a standard for the logging edited by the php-fig group (http://www.php-fig.org/psr/psr-3/)
Member of the phpBB Development-Team
No Support via PM

User avatar
Pony99CA
Registered User
Posts: 986
Joined: Sun Feb 08, 2009 2:35 am
Location: Hollister, CA
Contact:

Re: [RFC] logger/logging

Post by Pony99CA » Thu Jan 22, 2015 3:47 am

Nicofuma wrote:DI means Dependency Injection, and PSR3 is a standard for the logging edited by the php-fig group (http://www.php-fig.org/psr/psr-3/)
Thanks for the clarification. To be honest, I'm still not sure what "dependency injection" is, but I can Google that if I want to learn more. :D

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.

Post Reply