CommonLogger nil-logger fallback raises NameError
Puma::CommonLogger documents falling back to env['rack.errors'] when no explicit logger is provided, but write references env even though that local is not in scope. Logging after rack.after_reply therefore raises NameError.
A narrow source fix passes env from both normal and hijack logging paths into write.
Standalone reproduction: construct CommonLogger without a logger, invoke its after-reply callback, and assert the common-log line reaches rack.errors. Puma 8.0.2/current fail with undefined local variable or method 'env'; the candidate and explicit-logger control pass.
Local verification: focused upstream test_response_header:test_rack_server passes 28 runs /67 assertions; the changed file passes Ruby syntax and project RuboCop. I have not included a test patch here because I am reporting the defect first.
Source: puma/puma