简体   繁体   中英

How can I improve my logging in Rails?

Can anyone help with advice or resources on useful logs in Rails.

At the moment, I have the following line in my Apache virtual host:

CustomLog <loglocation>
LogLevel warn

My main issue is dealing with support requests. Recently a customer stated that they couldn't create a user in the application. I could see a 500 error in the log and I have the following line in my Users controller create method:

Rails.logger.debug(@user.errors.inspect)

But nothing appears in the log.

I've now had another customer say that email notifications have not been received and I have nowhere to start looking for the problem.

Any thoughts/advice would be appreciated.

Thanks

Robin

Install exception_notifier gem or use airbrake. There are wide variety of notification systems available to track these kind of errors https://www.ruby-toolbox.com/categories/exception_notification

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM