Giter Site home page Giter Site logo

Monolog and/or PSR-3 about fluent-logger-php HOT 3 CLOSED

fluent avatar fluent commented on September 13, 2024
Monolog and/or PSR-3

from fluent-logger-php.

Comments (3)

chobie avatar chobie commented on September 13, 2024

@aktau Thanks spotting it. following standard is a good way. I'll check it in this weekend.

from fluent-logger-php.

aktau avatar aktau commented on September 13, 2024

@chobie Thanks! It would be nice if you could investigate. Monolog is definitely one of the most used logging frameworks in the (modern) PHP world, and it already implements PSR-3. Usually I'm not a fan for too much standardization because it can grow mediocre solutions, but in the world of logging I think standardizations is absolutely a good thing. It means being able to swap backends easily, which is all I really care about with logging.

from fluent-logger-php.

chobie avatar chobie commented on September 13, 2024

https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md

I saw PSR-3 logger interface documentation. PSR-3 logger uses RFC 5424 log levels but usually we don't use that levels with fluentd.

let's assume the use case like this.

story: logging user error which user does not have right permission.

usage:
$psr3_fluent_logger->emergency("user", array("user_id" => 12345, "error_code" => ($permission_denied = 1));

output:
2013-05-28 emergency.user {user_id: 12345, error_code: 1}

Admitting that use case makes sense with fluentd. but it dose not make sense with other logger I think.
We can provide PSR-3 logger interface but I don't think this is good way.
Developers are able to switch log backends if we provide PSR-3 logger. but I don't think they want to collect messy logs.

Currently, there are several semistructured log collector: fluentd, scribed, flume...etc.
Those users have some objective to analyze corrected log data.
Not to put too fine a point on it. syslog style log message is just put log data. there is nothing more or less.

Anyway, I do not provide PSR-3 style logger at this time. I'll work when fig accepted PSR-N semistructured logger.

from fluent-logger-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.