'I want to print my logfile data into html.erb file

def cookies_conscent_log
    logger = Logger.new("conscent.log")
    logger.debug "IP Address: " + @country_ip + " | Country: " + @country_name + " | Consent status : " + @deliveries + " | Cookie type : " + @a + " | Time and date: #{Time.now.strftime("[%Y_%m_%d %H:%M:%S]")}".         values printing in log file
    logger.debug "------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
end

    

This is my controller method code used to get the values from Ajax call which I am printing in the log file. I am using Logger in rails to print the log file. The same data in my log file needs to be print on html.erb file. I want to display logfile data in tabular format that is why I am trying to get it in HTML file from log file. Is there any way to print logfile data into html.erb file.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source