title: Spring Boot AngularJs setting $log debug enabled from dynamic server value
body: <p>I am building an application with Spring Boot (jar) and AngularJS. I need the client debug log enabled property to be set based on the spring active profile. </p>
  
  <p>There are multiple properties files on the server, and which one of them to use is determined by the spring active profile. A configuration file loads the correct properties with <code>@PropertySource(value = { "client.${spring.profiles.active:local}.properties" })</code>. </p>
  
  <p>Next I am exposing these properties to an API call with a <code>@RestController</code>.</p>
  
  <p>However, it seems that one cannot (without some serious hacking and potential race condition) perform an HTTP request within the AngularJS configuration. Neither can the $logProvider be manipulated outside the configuration. </p>
  
  <p>I am at a loss, then, as to how I can, with best practices, get my log level property set. </p>
  
  <p>When I was using non-Boot Spring, with JSTL, I could add a javascript variable to the global namespace in a JSP page, but Spring Boot (jar) does not support JSP. </p>
  
  <p>I am looking for some insight into how I can allow my dynamic back end to set my AngularJS debug logging property. </p>