-
Notifications
You must be signed in to change notification settings - Fork 65
/
config.ru.example
39 lines (34 loc) · 1.04 KB
/
config.ru.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
ENV['RACK_ENV'] = "development"
require 'rubygems'
require 'bundler/setup'
# App-level logging is CURRENTLY DISABLED IN PRODUCTION.
#
# BEFORE EVER ENABLING IN PRODUCTION:
#
# Do the logging HERE -- NOT by enabling :logging in Sinatra,
# and NOT by turning on logging in a unicorn.rb.
#
# Log by uncommenting the lines below and updating the log path.
#
# PRESERVE THE FILTERING LOGIC.
#
# This will ensure that latitude and longitude are not written out
# to disk, as we promise to users in our API documentation.
#
# Bear in mind, application-level logging is slow and voluminous,
# and we have already implemented a similar filter at the nginx-level.
#
# Thus, logging at the application-level is currently NOT desired.
#
#
# logger = Logger.new("/path/to/unicorn.log")
# logger.instance_eval do
# def write(msg)
# # scrub latitude and longitude params from app-level logs
# msg.gsub! /(?:lat|long)itude=[\d\.\-]+/, 'XXX=XXX'
# self.send(:<<, msg)
# end
# end
# use Rack::CommonLogger, logger
require './congress'
run Sinatra::Application