Commit ce380d78 authored by Benjamin Neff's avatar Benjamin Neff Committed by Jonne Haß

make sql and federation debug-logging configurable

by default both are disabled now, you can enable them in the
diaspora.yml if you need them.

closes #6090
parent ea4eebd2
# 0.5.2.0
# Refactor
## Refactor
* Update perfect-scrollbar [#6085](https://github.com/diaspora/diaspora/pull/6085)
## Features
* Add configuration options for some debug logs [#6090](https://github.com/diaspora/diaspora/pull/6090)
# 0.5.1.0
## Refactor
......
......@@ -35,6 +35,9 @@ defaults:
logrotate:
enable: true
days: 7
debug:
sql: false
federation: false
server:
port:
listen: '0.0.0.0:3000'
......
......@@ -149,6 +149,17 @@ configuration: ## Section
## The number of days to keep (default=7)
#days: 7
## Debug logging
debug: ## Section
## Enables the debug-logging for SQL (default=false)
## This logs every SQL-statement!
#sql: true
## Enables the federation-debug-log (default=false)
## This logs all XMLs that are used for the federation
#federation: true
## Settings affecting how ./script/server behaves.
server: ## Section
## Where the appserver should listen to (default=0.0.0.0:3000)
......
......@@ -79,9 +79,15 @@ Logging::Rails.configure do |config|
#
# config.log_to = %w[stdout file]
#
Logging.logger.root.level = config.log_level
Logging.logger.root.appenders = config.log_to unless config.log_to.empty?
# Default log-level (development=debug, production=info)
Logging.logger.root.level = config.log_level
# log-levels from the diaspora.yml for SQL and federation debug-logging
Logging.logger[ActiveRecord::Base].level = AppConfig.environment.logging.debug.sql? ? :debug : :info
Logging.logger["XMLLogger"].level = AppConfig.environment.logging.debug.federation? ? :debug : :info
# Under Phusion Passenger smart spawning, we need to reopen all IO streams
# after workers have forked.
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment