This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
def log_error error_message | |
# Defining our log file path, can be named or located anywhere. | |
log_file_path = "#{Rails.root}/log/exception.log" | |
# Check if our log file exists. | |
file_available = File.exist? log_file_path | |
# Create log file if not available. | |
if file_available == false |