You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
819 B

2 years ago
2 years ago
2 years ago
  1. class WelcomeController < ApplicationController
  2. def index
  3. logger.measure_error "Took too long to complete", min_duration: 3000 do
  4. logger.debug("Debugging information to aid with problem determination")
  5. logger.info("Informational message such as request received\nline 2\nline3")
  6. logger.warn("Warn about something in the system")
  7. logger.error("An error occurred during processing")
  8. logger.fatal("Oh no something really bad happened")
  9. logger.measure_info "Called external interface" do
  10. sleep 0.1 # Code to call external service ...
  11. end
  12. SemanticLogger.tagged(user: "Jack", zip_code: 12345) do
  13. # All log entries in this block will include the above named tags
  14. logger.debug("Hello World")
  15. end
  16. # raise "exception"
  17. end
  18. end
  19. end