Giter Site home page Giter Site logo

Comments (8)

leehambley avatar leehambley commented on June 11, 2024

To clarify whilst the log cursor issue is a Rails problem, I cannot reproduce the broken escape characters in standalone Rails, nor in this contrived app under Foreman; but I do believe that foreman's output handler is causing the problem.

from foreman.

ddollar avatar ddollar commented on June 11, 2024

Foreman will display to the terminal output anything written to stdout by the processes it launches.

The broken escape codes may be from the buffer getting read across an escape code boundary which causes part of the escape code to be on two different lines with the foreman header in between. I'll have to look into this and see how I can fix it. Patches definitely welcome if you want to take a shot at it as well.

from foreman.

leehambley avatar leehambley commented on June 11, 2024

@ddollar thanks for getting back to me about this, eventually iTerm2 included an "ignore session initiated printing" option, which cured my problem.

I think the further problem is with the Rails log file cursor, same steps to reproduce, and you see a lot of Rails streaming the log, even if it was from another process (that is rails runner vs. script server) - do you think that should be considered a bug? (That it catches-up the log on the next web request?)

from foreman.

ddollar avatar ddollar commented on June 11, 2024

foreman is not actually tailing the log, it's just displaying whatever rails displays on stdout so there's probably not much I can do

from foreman.

leehambley avatar leehambley commented on June 11, 2024

@ddollar, good point, was mixing my terminology, except that foreman does prefix the log lines with | web.1 | or something, and that did seem to be where the print codes were coming from… I'll see if I can file this upstream at rails (rails should be more relaxed about the log cursor, I think, but I expect some limitations mean that it can't be)

from foreman.

ddollar avatar ddollar commented on June 11, 2024

Resolving ancient bugs. Please reopen if this is still an issue.

from foreman.

leehambley avatar leehambley commented on June 11, 2024

It still happens, but I'm pretty sure it's something to do with Rails chasing the log's EOF on the next web request; which is annoying. I don't think I ever remembered to open the bug upstream with Rails. If/when I do, I'll drop a link here. Cheers.

from foreman.

leehambley avatar leehambley commented on June 11, 2024

Update here, I just watched Railscats #391 (pro) and noticed something interesting, Rails only flushes writes to the logfile when the next rack request is finishing, it's handled by the Rails::Rack::Logger middleware.

So the workaround for anyone else suffering is to set the log to autoflush on any background jobs. such as Resque workers/etc, and/or open an issue with Rails and share your feeling that middleware isn't an appropriate place to be flushing logfiles.

from foreman.

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.