diff --git a/config/initializers/logger.rb b/config/initializers/logger.rb new file mode 100644 index 000000000..4411c0ead --- /dev/null +++ b/config/initializers/logger.rb @@ -0,0 +1,24 @@ +# If we want to change the directory do so here +# Rails.logger = ActiveSupport::Logger.new(STDOUT) + +Rails.logger = Logger.new( + Rails.root.join( + "log", + 'planorama.log' + ), + 'daily' +) + +Rails.logger.level = + case Rails.env + when 'development' + Logger::DEBUG + when 'test' + Logger::WARN + when 'staging' + Logger::WARN + when 'production' + Logger::ERROR + else + Logger::INFO + end diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml index 9504d16f3..413dfe4f2 100644 --- a/docker-compose-prod.yml +++ b/docker-compose-prod.yml @@ -38,6 +38,7 @@ services: - NODE_ENV=production command: /opt/planorama/script/planorama_start.sh volumes: + - /var/log/planorama/web:/opt/planorama/log - type: tmpfs target: /opt/planorama/tmp ports: @@ -60,6 +61,7 @@ services: - NODE_ENV=production command: /opt/planorama/script/planorama_sidekiq.sh volumes: + - /var/log/planorama/sidekiq:/opt/planorama/log - type: tmpfs target: /opt/planorama/tmp depends_on: