Skip to content

Commit

Permalink
create a log folder unless it exists and avoid crashing the app on st…
Browse files Browse the repository at this point in the history
…artup
  • Loading branch information
Angarsk8 committed Jul 17, 2016
1 parent 8b38924 commit f4ba9ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config/application.cr
@@ -1,5 +1,7 @@
Kemalyst::Application.config do |config|
# create a log file
# Creates "logs/" folder unless it exists
Dir.mkdir("logs") unless File.directory? "logs"

log = File.new("logs/#{config.env}.log", "a")
log.flush_on_newline = true

Expand Down

0 comments on commit f4ba9ae

Please sign in to comment.