From 1f73f061f75cb34eed0dee773b4ea0b453cb0619 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Fri, 8 Aug 2014 21:37:15 +0100 Subject: [PATCH] Always set DBIC_TRACE_PROFILE=console --- Netdisco/Changes | 1 + Netdisco/bin/netdisco-do | 2 +- Netdisco/lib/App/Netdisco/Configuration.pm | 3 +++ Netdisco/lib/App/Netdisco/Manual/Developing.pod | 4 ++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index a673ee06..7dc8d6b9 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -18,6 +18,7 @@ * Handle management IP of one device being in use on another device * Log at debug the vlan reindexing in macsuck * Add docs note about database backups + * Always set DBIC_TRACE_PROFILE=console in environment [BUG FIXES] diff --git a/Netdisco/bin/netdisco-do b/Netdisco/bin/netdisco-do index 8b3e2025..c4d66bbd 100755 --- a/Netdisco/bin/netdisco-do +++ b/Netdisco/bin/netdisco-do @@ -68,7 +68,7 @@ $CONFIG->{log} = ($debug ? 'debug' : 'info'); $ENV{INFO_TRACE} = $infotrace; $ENV{SNMP_TRACE} = $snmptrace; -$ENV{DBIC_TRACE} = $sqltrace; $ENV{DBIC_TRACE_PROFILE} = 'console'; +$ENV{DBIC_TRACE} = $sqltrace; # reconfigure logging to force console output Dancer::Logger->init('console', $CONFIG); diff --git a/Netdisco/lib/App/Netdisco/Configuration.pm b/Netdisco/lib/App/Netdisco/Configuration.pm index fe21ae77..504c6aca 100644 --- a/Netdisco/lib/App/Netdisco/Configuration.pm +++ b/Netdisco/lib/App/Netdisco/Configuration.pm @@ -79,4 +79,7 @@ $ENV{'PERL_ANYEVENT_MAX_OUTSTANDING_DNS'} $ENV{'PERL_ANYEVENT_HOSTS'} = setting('dns')->{hosts_file} || '/etc/hosts'; +# always set this +$ENV{DBIC_TRACE_PROFILE} = 'console'; + true; diff --git a/Netdisco/lib/App/Netdisco/Manual/Developing.pod b/Netdisco/lib/App/Netdisco/Manual/Developing.pod index dea39857..db993165 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Developing.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Developing.pod @@ -18,7 +18,7 @@ the L. Then: git clone git://git.code.sf.net/p/netdisco/netdisco-ng netdisco-ng cd netdisco-ng/Netdisco - DBIC_TRACE_PROFILE=console DBIC_TRACE=1 ~/bin/localenv plackup -R share,lib -p 5001 bin/netdisco-web-fg + DBIC_TRACE=1 ~/bin/localenv plackup -R share,lib -p 5001 bin/netdisco-web-fg The above creates you a git clone (change the URL if you're a Netdisco Developer) and runs the web server: @@ -52,7 +52,7 @@ some of the web client callbacks. For the daemon, it's very similar: - DBIC_TRACE_PROFILE=console DBIC_TRACE=1 ~/bin/localenv bin/netdisco-daemon-fg + DBIC_TRACE=1 ~/bin/localenv bin/netdisco-daemon-fg Don't be alarmed by the high rate of database queries in the daemon - most of them are communicating only with a local in-memory SQLite database.