PHP Classes

Create a logger to an application: I need a logger class to insert in file or database.

Recommend this page to a friend!
  All requests RSS feed  >  Create a logger to an application  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

Create a logger to an application

Edit

Picture of Romdhan Romeo KH by Romdhan Romeo KH - 1 year ago (2023-05-03)

I need a logger class to insert in file or database.

This request is clear and relevant.
This request is not clear or is not relevant.

+2

I need a logger class to insert in file or database.With this class we can detail of actions of application and what can be wrong.

Ask clarification

4 Recommendations

SLogger: Log messages following the PSR-3 specification

This package can log messages using log manager classes.

It provides a base log class that can take messages to be sent to logs following the PSR-3 specification.

The log class also take a manager object to process log messages in customizable ways.

Currently, the package provides a log manager class that can send log messages to files.

It also provides a log formatter class to output the log to a specific format.
This recommendation solves the problem.
This recommendation does not solve the problem.

+1

Picture of Eric AGNEL by Eric AGNEL package author package author Reputation 30 - 1 year ago (2023-09-29) Comment

SLogger is PSR3 compliant. Simple to use, php 8.1 required.

Support file logging for now, but you can easily create a database manager for your needs.


XLogger PHP PSR Logger: Log events to browser console, text and XML files

This package can be used to log events to the current browser console, text and XML files.

It provides support to logging of events with an interface compliant with PSR 3 PHP Standards Recommendation specification.

Currently it can log events using HTTP headers to pass log values to the current browser. The log messages may appear in the console or a separate Window section of the current browser when a specific browser add-on is installed. There are add-ons available for Firefox and Chrome.

It may also output log information to files in plain text or XML formats.
This recommendation solves the problem.
This recommendation does not solve the problem.

+2

Picture of Stefan Kientzler by Stefan Kientzler package author package author Reputation 425 - 1 year ago (2023-05-03) Comment

This package contains classes to log to different targets in various formats. In addition here is an interesting artvle about logging in an application: https://www.phpclasses.org/blog/package/11743/post/1-PSR3-logging-in-a-PHP-application.html


Log Delta Time: Log the time difference between PHP statements

This class can log the time difference between PHP statements.

It can write or append to a log file messages passed at different points of execution of a PHP script.

The class can output to the log file the message and the difference of time between the current and the previous log call.

Optionally it can log messages only if the time that elapsed since the last call exceeds a given minimum period.

The class can also log values of variables to identify better related log calls.
This recommendation solves the problem.
This recommendation does not solve the problem.

+2

Picture of Alessandro Quintiliani by Alessandro Quintiliani package author package author Reputation 120 - 1 year ago (2023-05-03) Comment

try this class: you instantiate it with three input parameters which are, in the order:

  • absolute or relative path to a directory where logfile is created inside
  • the name of the logfile created inside the directory
  • an integer, whose values are 0, 1, 2 where: 0 -> disable writing messages into logfile (usually this value is set when debugging is over) 1 -> enable writing messages into logfile in overwriting mode 2 -> enable writing messages into logfile in appending mode


ITE Logger: Log messages to different storage PSR-3 compliant

This package can log messages to different storage containers compliant with PSR-3.

It provides classes to log messages to files and abstract classes for sending emails with logs and writing them to database.

It also has classes using the php function mail() for sending logs and PDO for storing log messages to database tables.

This package includes a LoggerAggregator class and trait that allows using of multiple nested loggers for all or different log levels.

It also provides a stream namespace with a trait, classes and interfaces that can be useful to write logs with stream functions, like fopen('log://<logger-type>/<log-level>', 'w').
This recommendation solves the problem.
This recommendation does not solve the problem.

+1

Picture of Manuel Lemos by Manuel Lemos Reputation 26695 - 1 year ago (2023-05-03) Comment

Using PDO, this stylish package can log application messages to different containers, including files and database tables.

It provides interfaces compliant with the PHP Standards Recommendation 3 (PSR-3). So you can switch between different storage containers according to your application needs.


Recommend package
: 
: