The undisturbed or static formation temperature (SFT) is a key objective of the borehole measurements analysis. Conventional methods to estimate SFT require borehole temperature data measured during thermal recovery periods. As such, shut-in conditions should prevail for temperature logging, which can be both economically and technically prohibitive in actual operational conditions, especially for high-temperature boreholes. This study investigates the use of temperature logs obtained under injection conditions for SFT determination by applying a Bayesian inference approach--Markov Chain Monte Carlo (MCMC). In particular, surrogate models are trained using artificial neural networks to replace the original high-fidelity numerical models to save computational effort. The inversion scheme is firstly tested on three different synthetic scenarios where the formation all consists of multiple thermal layers (i.e., the initial geothermal gradient of each layer can be different). The results indicate a significant success of the method in predicting SFT profiles, given that the borehole temperature data and the surrogate model are accurate. In addition, if a fluid loss zone occurs along the borehole, the error of the estimated SFT below the loss zone is likely to increase. Furthermore, errors in the measured data also have a significant impact on the quality of the SFT estimates. For example, if the measurement has an error of ±1°C, the predicted SFT is found to have maximum errors ranging from 16.7 °C to 47.2 °C in the 95% confidence interval. Therefore, high-quality temperature data needs to be used to achieve reliable estimation results, and the uncertainty in the measured data should be integrated into the inversion procedure if possible. Finally, the method was applied to a real-world example where the SFT near the RN-15/IDDP-2 well in Iceland is estimated using drilling temperature data. As mentioned in Friðleifsson et al. 2020, the Reykjanes geothermal system exhibits both conductive and convective heat transport behavior in the formation at different depths. Therefore, this study also investigates different assumptions about the shape of the SFT profile. In one hypothesis, the thermal gradient is constant. In another, the formation consists of multiple layers where the thermal gradients can be different from each other. For each scenario, fluid losses at three reported depths during the drilling are jointly estimated with the SFT. The inversion results show that the predicted fluid losses are almost the same (with differences being less than 0.3%) under the two different hypotheses. However, the estimated SFT values can have much difference (maximum ~80 °C) at depths. Our results will be compared with other studies that use geophysical data to assess the formation temperature around the well. Their implication about the geothermal field around the investigated deep hot well will also be discussed.