Index: run.py
===================================================================
--- run.py	(revision ed03b996a797e011286b9cdc391ae5e761b7f22d)
+++ run.py	(revision 7c105e8be85f8686d7808e51eb16d79bb96fdda9)
@@ -139,5 +139,22 @@
     sys.path.append(build_path)
 
+    set_git_tag()
     # print "\n".join(sys.path)
+
+def set_git_tag():
+    try:
+        import subprocess
+        import os
+        import platform
+        FNULL = open(os.devnull, 'w')
+        if platform.system() == "Windows":
+            args = ['git', 'describe', '--tags']
+        else:
+            args = ['git describe --tags']
+        git_revision = subprocess.check_output(args, stderr=FNULL, shell=True)
+        import sas.sasview
+        sas.sasview.__build__ = str(git_revision).strip()
+    except subprocess.CalledProcessError as cpe:
+        logger.warning("Error while determining build number\n  Using command:\n %s \n Output:\n %s"% (cpe.cmd,cpe.output))
 
 
Index: src/sas/logger_config.py
===================================================================
--- src/sas/logger_config.py	(revision 7c105e8be85f8686d7808e51eb16d79bb96fdda9)
+++ src/sas/logger_config.py	(revision 7c105e8be85f8686d7808e51eb16d79bb96fdda9)
@@ -0,0 +1,83 @@
+from __future__ import print_function
+
+import logging
+import logging.config
+import os
+import os.path
+
+import pkg_resources
+
+
+'''
+Module that manages the global logging
+'''
+
+
+class SetupLogger(object):
+    '''
+    Called at the beginning of run.py or sasview.py
+    '''
+
+    def __init__(self, logger_name):
+        self._find_config_file()
+        self.name = logger_name
+
+    def config_production(self):
+        logger = logging.getLogger(self.name)
+        if not logger.root.handlers:
+            self._read_config_file()
+            logging.captureWarnings(True)
+            logger = logging.getLogger(self.name)
+        return logger
+
+    def config_development(self):
+        '''
+        '''
+        self._read_config_file()
+        logger = logging.getLogger(self.name)
+        self._update_all_logs_to_debug(logger)
+        logging.captureWarnings(True)
+        return logger
+
+    def _read_config_file(self):
+        if self.config_file is not None:
+            logging.config.fileConfig(self.config_file)
+
+    def _update_all_logs_to_debug(self, logger):
+        '''
+        This updates all loggers and respective handlers to DEBUG
+        '''
+        for handler in logger.handlers or logger.parent.handlers:
+            handler.setLevel(logging.DEBUG)
+        for name, _ in logging.Logger.manager.loggerDict.items():
+            logging.getLogger(name).setLevel(logging.DEBUG)
+
+    def _find_config_file(self, filename="logging.ini"):
+        '''
+        The config file is in:
+        Debug ./sasview/
+        Packaging: sas/sasview/
+        Packaging / production does not work well with absolute paths
+        thus the multiple paths below
+        '''
+        places_to_look_for_conf_file = [
+            os.path.join(os.path.abspath(os.path.dirname(__file__)), filename),
+            filename,
+            os.path.join("sas", "sasview", filename),
+            os.path.join(os.getcwd(), "sas", "sasview", filename),
+        ]
+
+        # To avoid the exception in OSx
+        # NotImplementedError: resource_filename() only supported for .egg, not .zip
+        try:
+            places_to_look_for_conf_file.append(
+                pkg_resources.resource_filename(__name__, filename))
+        except NotImplementedError:
+            pass
+
+        for filepath in places_to_look_for_conf_file:
+            if os.path.exists(filepath):
+                self.config_file = filepath
+                return
+        print("ERROR: Logging.ini not found...")
+        self.config_file = None
Index: src/sas/logging.ini
===================================================================
--- src/sas/logging.ini	(revision 7c105e8be85f8686d7808e51eb16d79bb96fdda9)
+++ src/sas/logging.ini	(revision 7c105e8be85f8686d7808e51eb16d79bb96fdda9)
@@ -0,0 +1,73 @@
+
+###############################################################################
+################################### LOGGING ###################################
+###############################################################################
+# Main logger for SASView
+
+# SEE: https://docs.python.org/2/library/logging.html#logrecord-attributes
+[formatters]
+keys=simple,detailed
+
+[formatter_simple]
+#format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
+#format=%(asctime)s - %(levelname)s : %(name)s:%(pathname)s:%(lineno)4d: %(message)s
+format=%(asctime)s - %(levelname)s : %(name)s:%(lineno)4d: %(message)s
+datefmt=%H:%M:%S
+
+[formatter_detailed]
+#format=%(asctime)s : %(levelname)s : %(name)s: %(lineno)d: %(message)s
+format=%(asctime)s : %(levelname)s : %(name)s (%(filename)s:%(lineno)s) :: %(message)s
+
+###############################################################################
+# Handlers
+
+[handlers]
+keys=console,log_file
+
+[handler_console]
+class=logging.StreamHandler
+formatter=simple
+level=WARNING
+args=tuple()
+
+[handler_log_file]
+class=logging.FileHandler
+level=DEBUG
+formatter=detailed
+args=(os.path.join(os.path.expanduser("~"),'sasview.log'),"a")
+
+###############################################################################
+# Loggers
+
+[loggers]
+keys=root,saspr,sasgui,sascalc,sasmodels
+
+[logger_root]
+level=DEBUG
+formatter=default
+handlers=console,log_file
+
+[logger_sasmodels]
+level=INFO
+qualname=sas.models
+handlers=console,log_file
+propagate=0
+
+[logger_saspr]
+level=INFO
+qualname=sas.pr
+handlers=console,log_file
+propagate=0
+
+[logger_sasgui]
+level=DEBUG
+qualname=sas.sasgui
+handlers=console,log_file
+propagate=0
+
+[logger_sascalc]
+level=INFO
+qualname=sas.sascalc
+handlers=console,log_file
+propagate=0
+
Index: src/sas/sasview/__init__.py
===================================================================
--- src/sas/sasview/__init__.py	(revision 899e084c5a4f0e16bee8152f20438288d95e87ec)
+++ src/sas/sasview/__init__.py	(revision 7c105e8be85f8686d7808e51eb16d79bb96fdda9)
@@ -1,21 +1,2 @@
 __version__ = "4.1"
 __build__ = "GIT_COMMIT"
-
-import logging
-logger = logging.getLogger(__name__)
-
-try:
-    import subprocess
-    import os
-    import platform
-    FNULL = open(os.devnull, 'w')
-    if platform.system() == "Windows":
-        args = ['git', 'describe', '--tags']
-    else:
-        args = ['git describe --tags']
-    git_revision = subprocess.check_output(args,
-                    stderr=FNULL,
-                    shell=True)
-    __build__ = str(git_revision).strip()
-except subprocess.CalledProcessError as cpe:
-    logger.warning("Error while determining build number\n  Using command:\n %s \n Output:\n %s"% (cpe.cmd,cpe.output))
Index: c/sas/sasview/logger_config.py
===================================================================
--- src/sas/sasview/logger_config.py	(revision 2f6d340b9cd179b18c2a4efe77d149f45c7e98de)
+++ 	(revision )
@@ -1,83 +1,0 @@
-from __future__ import print_function
-
-import logging
-import logging.config
-import os
-import os.path
-
-import pkg_resources
-
-
-'''
-Module that manages the global logging
-'''
-
-
-class SetupLogger(object):
-    '''
-    Called at the beginning of run.py or sasview.py
-    '''
-
-    def __init__(self, logger_name):
-        self._find_config_file()
-        self.name = logger_name
-
-    def config_production(self):
-        logger = logging.getLogger(self.name)
-        if not logger.root.handlers:
-            self._read_config_file()
-            logging.captureWarnings(True)
-            logger = logging.getLogger(self.name)
-        return logger
-
-    def config_development(self):
-        '''
-        '''
-        self._read_config_file()
-        logger = logging.getLogger(self.name)
-        self._update_all_logs_to_debug(logger)
-        logging.captureWarnings(True)
-        return logger
-
-    def _read_config_file(self):
-        if self.config_file is not None:
-            logging.config.fileConfig(self.config_file)
-
-    def _update_all_logs_to_debug(self, logger):
-        '''
-        This updates all loggers and respective handlers to DEBUG
-        '''
-        for handler in logger.handlers or logger.parent.handlers:
-            handler.setLevel(logging.DEBUG)
-        for name, _ in logging.Logger.manager.loggerDict.items():
-            logging.getLogger(name).setLevel(logging.DEBUG)
-
-    def _find_config_file(self, filename="logging.ini"):
-        '''
-        The config file is in:
-        Debug ./sasview/
-        Packaging: sas/sasview/
-        Packaging / production does not work well with absolute paths
-        thus the multiple paths below
-        '''
-        places_to_look_for_conf_file = [
-            os.path.join(os.path.abspath(os.path.dirname(__file__)), filename),
-            filename,
-            os.path.join("sas", "sasview", filename),
-            os.path.join(os.getcwd(), "sas", "sasview", filename),
-        ]
-
-        # To avoid the exception in OSx
-        # NotImplementedError: resource_filename() only supported for .egg, not .zip
-        try:
-            places_to_look_for_conf_file.append(
-                pkg_resources.resource_filename(__name__, filename))
-        except NotImplementedError:
-            pass
-
-        for filepath in places_to_look_for_conf_file:
-            if os.path.exists(filepath):
-                self.config_file = filepath
-                return
-        print("ERROR: Logging.ini not found...")
-        self.config_file = None
Index: c/sas/sasview/logging.ini
===================================================================
--- src/sas/sasview/logging.ini	(revision 2f6d340b9cd179b18c2a4efe77d149f45c7e98de)
+++ 	(revision )
@@ -1,73 +1,0 @@
-
-###############################################################################
-################################### LOGGING ###################################
-###############################################################################
-# Main logger for SASView
-
-# SEE: https://docs.python.org/2/library/logging.html#logrecord-attributes
-[formatters]
-keys=simple,detailed
-
-[formatter_simple]
-#format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
-#format=%(asctime)s - %(levelname)s : %(name)s:%(pathname)s:%(lineno)4d: %(message)s
-format=%(asctime)s - %(levelname)s : %(name)s:%(lineno)4d: %(message)s
-datefmt=%H:%M:%S
-
-[formatter_detailed]
-#format=%(asctime)s : %(levelname)s : %(name)s: %(lineno)d: %(message)s
-format=%(asctime)s : %(levelname)s : %(name)s (%(filename)s:%(lineno)s) :: %(message)s
-
-###############################################################################
-# Handlers
-
-[handlers]
-keys=console,log_file
-
-[handler_console]
-class=logging.StreamHandler
-formatter=simple
-level=WARNING
-args=tuple()
-
-[handler_log_file]
-class=logging.FileHandler
-level=DEBUG
-formatter=detailed
-args=(os.path.join(os.path.expanduser("~"),'sasview.log'),"a")
-
-###############################################################################
-# Loggers
-
-[loggers]
-keys=root,saspr,sasgui,sascalc,sasmodels
-
-[logger_root]
-level=DEBUG
-formatter=default
-handlers=console,log_file
-
-[logger_sasmodels]
-level=INFO
-qualname=sas.models
-handlers=console,log_file
-propagate=0
-
-[logger_saspr]
-level=INFO
-qualname=sas.pr
-handlers=console,log_file
-propagate=0
-
-[logger_sasgui]
-level=DEBUG
-qualname=sas.sasgui
-handlers=console,log_file
-propagate=0
-
-[logger_sascalc]
-level=INFO
-qualname=sas.sascalc
-handlers=console,log_file
-propagate=0
-
Index: src/sas/sasview/sasview.py
===================================================================
--- src/sas/sasview/sasview.py	(revision 899e084c5a4f0e16bee8152f20438288d95e87ec)
+++ src/sas/sasview/sasview.py	(revision 7c105e8be85f8686d7808e51eb16d79bb96fdda9)
@@ -16,16 +16,8 @@
 import sys
 import traceback
-
-from sas.sasview.logger_config import SetupLogger
+import logging
 
 reload(sys)
 sys.setdefaultencoding("iso-8859-1")
-
-logger = SetupLogger(__name__).config_production()
-# Log the start of the session
-logger.info(" --- SasView session started ---")
-# Log the python version
-logger.info("Python: %s" % sys.version)
-
 
 PLUGIN_MODEL_DIR = 'plugin_models'
@@ -39,4 +31,6 @@
         """
         """
+        logger = logging.getLogger(__name__)
+
         from sas.sasgui.guiframe.gui_manager import SasViewApp
         self.gui = SasViewApp(0)
@@ -119,20 +113,12 @@
 
 def setup_logging():
-    log_file = os.path.join(os.path.expanduser("~"), 'sasview.log')
-    logging.basicConfig(level=logging.INFO,
-                        format='%(asctime)s %(levelname)s %(message)s',
-                        filename=log_file,
-                        )
-    logging.captureWarnings(True)
-
-    stderr_logger = logging.getLogger('STDERR')
-    sl = StreamToLogger(stderr_logger, logging.ERROR)
-    sys.stderr = sl
-
+    from sas.logger_config import SetupLogger
+
+    logger = SetupLogger(__name__).config_production()
     # Log the start of the session
-    logging.info(" --- SasView session started ---")
-
+    logger.info(" --- SasView session started ---")
     # Log the python version
-    logging.info("Python: %s" % sys.version)
+    logger.info("Python: %s" % sys.version)
+    return logger
 
 
@@ -143,4 +129,5 @@
     # probably not be, but this can make things a little easier when upgrading to a
     # new version of wx.
+    logger = logging.getLogger(__name__)
     WX_ENV_VAR = "SASVIEW_WX_VERSION"
     if WX_ENV_VAR in os.environ:
@@ -200,4 +187,5 @@
 
 def run_cli():
+    setup_logging()
     setup_mpl()
     if len(sys.argv) == 1:
