Is there any way to automatically log everytime an ActiveRecord callback happens? It would help to trace through why certain things are happened when a record has several ca
The easier way is to use the rails native logger methods:
Debugging Rails Applications
Using it like this:
logger.debug "Person attributes hash: #{@person.attributes.inspect}"
logger.info "Processing the request..."
logger.fatal "Terminating application, raised unrecoverable error!!!"
Edit:
To check what was called when an exception ocurred is also interesting to use
logger.error("trace: #{ex.backtrace().join("\n")}")