Comments (8)
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.
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.
@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.
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.
@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.
Resolving ancient bugs. Please reopen if this is still an issue.
from foreman.
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.
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)
- Odd error message when you skip the 'start' command and include a -f
- Using RuboCop?
- issue killing subprocesses using `cd` with failure at startup HOT 1
- breakpoint vscode not work to Ruby
- After the foreman finishes, the ruby process continues to exist HOT 2
- Release 1.0? HOT 1
- About link is broken HOT 1
- Foreman does not terminate child process HOT 3
- Forman doesn't show errors and logs of Procfile commands HOT 3
- Change https://ddollar.github.com/foreman to https://ddollar.github.io/foreman on repo description link
- Port 5000 taken by Mac OSX HOT 1
- When launching rails via foreman, rails asset pipeline errors
- Support for x64-mingw-ucrt platform
- Version Optimize
- Document that Foreman secretly sets the PORT environment variable to 5000 HOT 1
- Error after running command "foreman start"
- foreman export systemd raises undefined method `exists?' for File:Class (NoMethodError) HOT 1
- Security CVE-2022-3874 HOT 4
- Usage Error: Unrecognized or legacy configuration settings found
- Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/engine.rb:201:in `kill': Invalid argument (Errno::EINVAL)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foreman.