Reputation: 800
We are building a tenant based web app using acts_as_tenant gem. Since we are running same app for all the tenants so we have only one log file in whole system. This is causing problem when we need to analyze log of a particular tenant, Currently we are using grep utility to grep on relevant keyword. Obviously this is not an ideal solution. I am looking for a solution where we can have multiple log files one log file per tenant.
Upvotes: 0
Views: 386
Reputation: 15967
This is the point of a tagged logger and rails has one built in:
Rails.logger.tagged(my_tenant) do
run_some_code
end
This will produce:
[MyTenant] - Updated something in database...
Any good log tool will allow you to easily filter, slice & dice by tag(s).
Upvotes: 1