 										type: if entry.level == "error" then "error" else "warning"
 										text: entry.message
 									}
-					# Get the biber log and parse it too
-					$http.get "/project/#{$scope.project_id}/output/output.blg" + qs
+					# Get the biber log and parse it
+					if outputFile?.build?
+						biberLogUrl = "/project/#{$scope.project_id}/build/#{outputFile.build}/output/output.blg"
+					else
+						biberLogUrl = "/project/#{$scope.project_id}/output/output.blg"
+					$http.get biberLogUrl
 						.success (log) ->
 							window._s = $scope
 							biberLogEntries = BibLogParser.parse(log, {})

			else if response.status == "success"
				$scope.pdf.view = 'pdf'
				$scope.shouldShowLogs = false
				# define the base url
				$scope.pdf.url = "/project/#{$scope.project_id}/output/output.pdf?cache_bust=#{Date.now()}"
				# add a query string parameter for the compile group
				if response.compileGroup?
					$scope.pdf.compileGroup = response.compileGroup
					$scope.pdf.url = $scope.pdf.url + "&compileGroup=#{$scope.pdf.compileGroup}"
				# make a cache to look up files by name
				fileByPath = {}
				for file in response.outputFiles
					fileByPath[file.path] = file
				# if the pdf file has a build number, pass it to the clsi
				if fileByPath['output.pdf']?.build?
					build = fileByPath['output.pdf'].build
					$scope.pdf.url = $scope.pdf.url + "&build=#{build}"

				fetchLogs(fileByPath['output.log'])


					$scope.pdf.outputFiles.push file

		fetchLogs = (outputFile) ->
			if outputFile?.build?
				logUrl = "/project/#{$scope.project_id}/build/#{outputFile.build}/output/output.log"
			else
				logUrl = "/project/#{$scope.project_id}/output/output.log"
			$http.get logUrl
				.success (log) ->
					#console.log ">>", log
					$scope.pdf.rawLog = log
