Added a log message to show the modified URL and added guard conditions ...

Added a debug log message to show the modified URL by the addContextPath method. Also added guard conditions to debug log messages