3 ms·
Seems kind of awkward. Thinking about it offhand using some Rails terminology, let's see. * Naive version: save user information after every request via after
by davidw 14y ago
Seems kind of awkward.
Thinking about it offhand using some Rails terminology, let's see.
* Naive version: save user information after every request via after_filter or some other hook. Probably slow for sites that get a lot of traffic.
* Slightly less naive version: check to see if current_user.browser_info has changed compared to the current request in an after_filter or other hook. If so, save it in the DB. This way you can not only check what they're using right now, but what they were doing yesterday when they did something that caused your site to go haywire.
* I'm sure the above can be improved on: it'd be nice to package it up as a gem. This is not rocket science.
Looking in the logs is easy enough, but it's data that should be very easily available to support people, and they probably should not have ssh access to the server...
- mgkimsal 14y ago" save user information after every request via after_filter or some other hook. Probably slow for sites that get a lot of traffic." Probably really wouldn't be that slow, unless done really naively - much of that information is already being written to a web server logfile in most cases, and that doesn't slow things down too much. Send the info to a separate logging server/db. If you're getting a lot of traffic, you're possibly doing a lot of queries anyway - one more is incrementally painful, but shouldn't be a killer.
- meaty 14y agoThat's naive and inefficient. We only care if there is a system error, if the user phones up or they fill in the online support form. This is only to satisfy the path of the phone call. Everything else is passed around with context. For the phone call, our logging system has a web interface (log4net appender -> postgres -> asp.net web forms page). you just visit a web page and copy and type the error ID in and you get everything from the entire context, session and client info to the stack dump.