Using logging in multiple modules

Best practice is, in each module, to have a logger defined like this: import logging logger = logging.getLogger(__name__) near the top of the module, and then in other code in the module do e.g. logger.debug(‘My message with %s’, ‘variable data’) If you need to subdivide logging activity inside a module, use e.g. loggerA = logging.getLogger(__name__ … Read more

Where is the global git config data stored?

Update 2016: with git 2.8 (March 2016), you can simply use: git config –list –show-origin And with Git 2.26 (Q1 2020), you can add a –show-scope option git config –list –show-origin –show-scope You will see which config is set where. See “Where do the settings in my Git configuration come from?“ As Stevoisiak points out … Read more

Spring Boot and multiple external configuration files

UPDATE: As the behaviour of spring.config.location now overrides the default instead of adding to it. You need to use spring.config.additional-location to keep the defaults. This is a change in behaviour from 1.x to 2.x When using Spring Boot the properties are loaded in the following order (see Externalized Configuration in the Spring Boot reference guide). … Read more

Error when trying to get section using XYZ pcmsim = (XYZ)appConfig.GetSection(“XYZ”);

The value given for the type attribute represents the assembly-qualified name of the CustomSection type. From the Type.AssemblyQualifiedName documentation The assembly-qualified name of a type consists of the type name, including its namespace, followed by a comma, followed by the display name of the assembly. ConfigurationPropertyExample.CustomSection, ConfigurationPropertyExample from left to right consists of the namespace: … Read more