Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PID to log strings? #2031

Closed
MSP-Greg opened this issue Oct 12, 2019 · 2 comments
Closed

Add PID to log strings? #2031

MSP-Greg opened this issue Oct 12, 2019 · 2 comments
Labels

Comments

@MSP-Greg
Copy link
Member

While working on updated tests, I (again) came across an issue with testing, specifically the integration testing.

When a restart is used in testing, the PID changes, so closing Puma requires some way to determine the new PID.

A workaround is to always write a pid file, and read the PID in the teardown. Another option would be to write the PID in the log strings.

Would a change like the below be considered a breaking change?

Puma starting in single mode...

to:

Puma (pid: 3008) starting in single mode...

Rather read a string from IO rather than write read a file....

@nateberkopec
Copy link
Member

Hm, what’s wrong with the pidfile option?

Sent with GitHawk

@natematykiewicz
Copy link

Isn’t this already achievable via this PR? #1816

Just set your config to:

log_formatter do |str|
  "[#{Process.pid}]: #{str}"
end

and it’ll output:

"[3008]: Puma starting in single mode...“

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants