Log4Net config in external file does not work

Do you have the following attribute in your AssemblyInfo.cs file: [assembly: log4net.Config.XmlConfigurator(ConfigFile = “Log4Net.config”, Watch = true)] and code like this at the start of each class that requires logging functionality: private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); I have a blog post containing this and other info here.

Call external JS file based on “media screen” value

You can’t do that directly using Javascript <script> tags. Media queries are used in linked CSS files or inline CSS styles. A basic example: <link rel=”stylesheet” media=”screen and (min-width: 900px)” href=”https://stackoverflow.com/questions/15823137/desktop.css”/> <link rel=”stylesheet” media=”screen and (min-width: 571px)” href=”tablet.css”/> <link rel=”stylesheet” media=”screen and (max-width: 570px)” href=”mobile.css”/> Or directly in your stylesheets: @media screen and (max-width: 599px) … Read more

Externalizing Grails Datasource configuration

You can use a properties file specified in the grails.config.locations as a way to externalize the datasource configuration. Below is how I typically set up a Grails project: In my DataSource.groovy I specify this for the production environment: …. …. production { dataSource { dbCreate = “update” driverClassName = “com.myorg.jdbcDriverNotExists” url = “” username = … Read more