Browse Source

Log in development

master
Dylan Baker 8 months ago
parent
commit
bfc8cd2511
2 changed files with 4 additions and 1 deletions
  1. 1
    0
      .gitignore
  2. 3
    1
      db/connect.rb

+ 1
- 0
.gitignore View File

@@ -2,3 +2,4 @@
2 2
 vendor/
3 3
 web/public/*.css
4 4
 web/public/*.js
5
+db/log

+ 3
- 1
db/connect.rb View File

@@ -1,4 +1,5 @@
1 1
 require 'dotenv'
2
+require 'logger'
2 3
 
3 4
 Dotenv.load(File.expand_path('../.env'))
4 5
 
@@ -7,5 +8,6 @@ DB =
7 8
     adapter: :postgres,
8 9
     database: ENV['DB_DATABASE'],
9 10
     user: ENV['DB_USERNAME'],
10
-    password: ENV['DB_PASSWORD']
11
+    password: ENV['DB_PASSWORD'],
12
+    logger: ENV['APP_ENV'] == 'development' ? Logger.new('db/log') : nil
11 13
   )

Loading…
Cancel
Save