Coder Social home page Coder Social logo

Comments (5)

Seldaek avatar Seldaek commented on July 1, 2024

You should be able to use a StreamHandler with php://stdout or php://stderr as URL?

from monolog.

javaDeveloperKid avatar javaDeveloperKid commented on July 1, 2024

php://stdout (or err) is the stream for the running process, right? I would like to use a stream from another process. Example:
In first terminal:

# start the web server (this could be also an fpm docker image running)
$ php -S 127.0.0.1 index.php
# this terminal is a php://stderr for the web server

In second terminal:

# run api tests that send api calls to web server
$ vendor/bin/phpunit
# this terminal is a php://stderr for the unit tests

I would like to send logs also to the second terminal.

from monolog.

Seldaek avatar Seldaek commented on July 1, 2024

Ah I see.. then IMO the next best thing might be to have a step after phpunit is done that checks the test log file and outputs anything that's in it if present.. There are for sure other options to communicate between processes but that doesn't really seem worth the hassle here to have a custom handler talking to the phpunit process etc.

from monolog.

javaDeveloperKid avatar javaDeveloperKid commented on July 1, 2024

Good idea. With this solution one more thing that's required to do is to create a single file per one test run. Will check if RotatingFileHandler can be configured for that.
Or empty the file before tests start.

from monolog.

Seldaek avatar Seldaek commented on July 1, 2024

Yeah I'd empty it in the tests bootstrap, keep it simple.

from monolog.

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.