Class: Com::LogController
Constant Summary
RailsCom::Application::LOCALE_MAP
Instance Method Summary
collapse
#current_title, #default_form_params, #default_params, #json_format?, #set_country, #set_flash, #set_locale, #set_timezone, #set_variant
Instance Method Details
#csp ⇒ Object
12
13
14
15
16
17
18
19
20
|
# File 'app/controllers/com/log_controller.rb', line 12
def csp
data = JSON.parse(request.body.read)
p = data.fetch('csp-report', {})
p.transform_keys!(&:underscore)
LogCsp.create(p)
head :no_content
end
|
#index ⇒ Object
22
23
24
25
26
27
|
# File 'app/controllers/com/log_controller.rb', line 22
def index
path = Rails.root + RailsCom.config.not_found_logger.instance_variable_get(:@logdev).filename
result = `tail -n200 #{path}`
render plain: result
end
|
#not_found ⇒ Object
5
6
7
8
9
10
|
# File 'app/controllers/com/log_controller.rb', line 5
def not_found
params.permit!
RailsCom.config.not_found_logger.info "#{params[:path]}.#{params[:format]}"
head :not_found
end
|