How to: Add Extra Logging for LDAP Troubleshooting in Release and Deploy

Issue

After trying to set up Deploy or Release for LDAP authentication, LDAP users cannot sign on. The logs have no helpful information.

Environment

Deploy, Release, LDAP, Active Directory

Cause

Default logging is insufficient to diagnose some LDAP configuration issues

Resolution

Logging can be turned up and consolidated in a separate log file to make it easier to follow the events.  At the end of Deploy or Release home/conf/logback.xml, just before the </configuration> tag, add the following appender and loggers, and then restart.  Sign-on events can then be found in Deploy or Release home/log/ldapsecurity.log:

<appender name="SEC_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>log/ldapsecurity.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>log/ldapsecurity.%i.log</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>5</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>5MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] {%mdc} %-5level %logger{36} -
%msg%n</pattern>
</encoder>
</appender>
<logger name="com.xebialabs.deployit.security" level="debug" additivity="false">
<appender-ref ref="SEC_FILE" />
</logger>
<logger name="org.springframework.security" level="debug" additivity="false">
<appender-ref ref="SEC_FILE" />
</logger>
<logger name="org.springframework.ldap" level="debug" additivity="false">
<appender-ref ref="SEC_FILE" />
</logger>

Additional Information

level="debug" can be turned up to level="trace" for any of the above loggers as needed

 

 

Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.