Challenge - 5 Problems
Logging and Monitoring Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Understanding Rails Logger Output Level
Given the following Rails logger configuration, what will be the output when a
logger.debug message is logged?config.log_level = :info
Ruby on Rails
logger.debug("Debug message")Attempts:
2 left
💡 Hint
Remember that the log level filters out messages below its severity.
✗ Incorrect
The log level :info means only messages with severity info and above (warn, error, fatal) are logged. Debug messages are below info and thus ignored.
🧠 Conceptual
intermediate1:30remaining
Purpose of Log Rotation in Rails
Why is log rotation important in a Rails application running in production?
Attempts:
2 left
💡 Hint
Think about disk space and log file size.
✗ Incorrect
Log rotation helps keep log files manageable by archiving or deleting old logs, preventing disk space exhaustion.
❓ Troubleshoot
advanced2:30remaining
Diagnosing Missing Logs in Production
A Rails app in production is not showing any logs for errors, even though errors occur. Which configuration issue is the most likely cause?
Attempts:
2 left
💡 Hint
Check which log levels are recorded.
✗ Incorrect
Setting log_level to :fatal means only fatal errors are logged. Other errors like standard errors may be ignored, causing missing logs.
🔀 Workflow
advanced3:00remaining
Setting Up Basic Monitoring for a Rails App
Which sequence of steps correctly describes setting up basic application monitoring using a tool like New Relic in a Rails app?
Attempts:
2 left
💡 Hint
Think about installation, configuration, restart, then verification.
✗ Incorrect
You first add the gem, configure it, restart the app to load config, then check the dashboard for data.
✅ Best Practice
expert2:30remaining
Choosing the Best Logging Format for Production
Which logging format is best practice for a Rails production app to facilitate log aggregation and analysis?
Attempts:
2 left
💡 Hint
Consider ease of parsing by log management tools.
✗ Incorrect
JSON logs are structured and easily parsed by log aggregation tools, making analysis and searching efficient.