title: Spring Security authentication logging
body: <p>I am using Spring Security 3.1 to authenticate users for a website.  When a login fails because spring security is unable to connect to the database, I get the following statement in my log:</p>
  
  <pre><code>2012-07-12 11:42:45,419 [ajp-bio-8009-exec-1] DEBUG      org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter - Authentication request failed: org.springframework.security.authentication.AuthenticationServiceException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
  </code></pre>
  
  <p>My question is, why is this a DEBUG statement instead of an ERROR?  I have to wade through a whole lot of debug statements just to find the actual error.</p>
  
  <p>EDIT</p>
  
  <p>Here is my authentication manager:</p>
  
  <pre><code>&lt;bean id="securityDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
      &lt;property name="jndiName" value="java:comp/env/securityDS"/&gt;
      &lt;property name="resourceRef" value="true"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="encoder" class="org.springframework.security.crypto.password.StandardPasswordEncoder" /&gt;
  
  &lt;security:authentication-manager&gt;
      &lt;security:authentication-provider&gt;
          &lt;security:password-encoder ref="encoder" /&gt;
          &lt;security:jdbc-user-service 
              data-source-ref="securityDataSource"
              authorities-by-username-query="SELECT username, authority FROM login WHERE username = ?"
              users-by-username-query="SELECT username, password, enabled FROM login WHERE username = ?"
          /&gt;        
      &lt;/security:authentication-provider&gt;
  &lt;/security:authentication-manager&gt;
  </code></pre>