Note that there are some explanatory texts on larger screens.

plurals
  1. PORails production.log (using Passenger) being written to by multiple processes, can't be parsed
    primarykey
    data
    text
    <p>Here's a snippet of my production.log:</p> <pre><code>Started GET "/product/514034/754240" for XX.XX.202.138 at 2012-06-21 11:52:28 -0700 Started GET "/product/614409/666897" for XX.XX.228.38 at 2012-06-21 11:52:28 -0700 Processing by ProductsController#show as HTML Parameters: {"category_id"=&gt;"514034", "product_id"=&gt;"754240"} Processing by ProductsController#show as HTML Parameters: {"category_id"=&gt;"614409", "product_id"=&gt;"666897"} Logged in 2940659 via auth cookie Logged in 585210 via auth cookie [e3e3fc56bb6bd137741b269ee397683c] [2940659] Read fragment views/global-caches/header (0.7ms) [e3e3fc56bb6bd137741b269ee397683c] [2940659] Rendered shared/_email_form.html.haml (0.7ms) [d81bb986be5acc0277c0c9e11b414249] [585210] Read fragment views/global-caches/sharebar-message (0.7ms) [d81bb986be5acc0277c0c9e11b414249] [585210] Rendered shared/_email_form.html.haml (0.7ms) ... </code></pre> <p>As you can see, it's logging two concurrent sessions of two different users simultaneously to the same log file. This makes it impossible to parse my logs and determine, for example, the time it took to generate each kind of page, because the entries are not in the expected order of: </p> <pre><code>Started GET "/URL/BLAH" for IP at DATE ... stuff... Completed 200 OK in XXms (ActiveRecord: YY.Yms) </code></pre> <p>Instead I get an unpredictable interleaved log like this:</p> <pre><code>Started GET "/URL/BLAH" for IP at DATE Started GET "/URL/BLAH" for IP at DATE ... stuff... Completed 200 OK in XXms (ActiveRecord: YY.Yms) ...stuff... Completed 200 OK in XXms (ActiveRecord: YY.Yms) </code></pre> <p>So it's impossible to match the "completeds" with the "Started."</p> <p>What I'd like is a way to have each child process write to its own log or something. Or if it's possible a way to write the each pageview's log atomically, but that might be impossible or difficult or hurt performance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload