{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,6,30]],"date-time":"2026-06-30T19:12:06Z","timestamp":1782846726396,"version":"3.54.5"},"reference-count":70,"publisher":"Association for Computing Machinery (ACM)","issue":"FSE","license":[{"start":{"date-parts":[[2026,6,30]],"date-time":"2026-06-30T00:00:00Z","timestamp":1782777600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/legalcode"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Proc. ACM Softw. Eng."],"published-print":{"date-parts":[[2026,6,30]]},"abstract":"<jats:p>Logging code plays an important role in software systems by recording key events and behaviors, which are essential for debugging and monitoring. However, insecure logging practices can inadvertently expose sensitive information or enable attacks such as log injection, posing serious threats to system security and privacy. Prior research has examined general defects in logging code, but systematic analysis of logging code security issues remains limited, particularly in leveraging LLMs for detection and repair. In this paper, we derive a comprehensive taxonomy of logging code security issues, encompassing four common issue categories and 10 corresponding patterns. We further construct a benchmark dataset with 101 real-world logging security issue reports that have been manually reviewed and annotated. We then propose an automated framework that incorporates various contextual knowledge to evaluate LLMs' capabilities in detecting and repairing logging security issues. Our experimental results reveal a notable disparity in performance: while LLMs are moderately effective at detecting security issues (e.g., the accuracy ranges from 12.9% to 52.5% on average), they face noticeable challenges in reliably generating correct code repairs. We also find that the issue description alone improves the LLMs' detection accuracy more than the security pattern explanation or a combination of both. Overall, our findings provide actionable insights for practitioners and highlight the potential and limitations of current LLMs for secure logging.<\/jats:p>","DOI":"10.1145\/3797129","type":"journal-article","created":{"date-parts":[[2026,6,30]],"date-time":"2026-06-30T17:06:14Z","timestamp":1782839174000},"page":"745-765","source":"Crossref","is-referenced-by-count":0,"title":["Towards Secure Logging: Characterizing and Benchmarking Logging Code Security Issues with LLMs"],"prefix":"10.1145","volume":"3","author":[{"ORCID":"https:\/\/orcid.org\/0009-0005-6509-1198","authenticated-orcid":false,"given":"He Yang","family":"Yuan","sequence":"first","affiliation":[{"name":"York University, Toronto, Canada"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0004-0016-9380","authenticated-orcid":false,"given":"Xin","family":"Wang","sequence":"additional","affiliation":[{"name":"Hong Kong University of Science and Technology (Guangzhou), Guangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-3756-4673","authenticated-orcid":false,"given":"Kundi","family":"Yao","sequence":"additional","affiliation":[{"name":"University of Waterloo, Waterloo, Canada"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-3137-7540","authenticated-orcid":false,"given":"An Ran","family":"Chen","sequence":"additional","affiliation":[{"name":"University of Alberta, Edmonton, Canada"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-0803-5609","authenticated-orcid":false,"given":"Zishuo","family":"Ding","sequence":"additional","affiliation":[{"name":"Hong Kong University of Science and Technology (Guangzhou), Guangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-4909-1535","authenticated-orcid":false,"given":"Zhenhao","family":"Li","sequence":"additional","affiliation":[{"name":"York University, Toronto, Canada"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2026,6,30]]},"reference":[{"key":"e_1_2_1_1_1","unstructured":"RQ2 Summary: Overall the detection accuracy of LLMs at the category level varies widely ranging from 12.9% to 52.5% on average across models and settings. Adding an issue description (+D) generally provides the most consistent improvement. In addition performance differs considerably across patterns: models achieve high accuracy on concrete issues such as Sensitive Information Exposure (SS) but consistently struggle with abstract logic-based flaws like Improper Redaction or Masking (RM) where accuracy often falls below 20%."},{"key":"e_1_2_1_2_1","unstructured":"3 RQ3: To what extent can LLMs repair security issues in logging code? Table 3. Patch Similarity for Different LLMs."},{"key":"e_1_2_1_3_1","unstructured":"Setting GPT-4.1-nano Llama3.3 DeepSeek-R1-32b DeepSeek-R1 DeepSeek-V3 Qwen2.5-72B Qwen3-4B Qwen3-32B Avg."},{"key":"e_1_2_1_4_1","volume-title":"CVE: Common Vulnerabilities and Exposures. https:\/\/www.cve.org\/. Last accessed","year":"2025","unstructured":"2025. CVE: Common Vulnerabilities and Exposures. https:\/\/www.cve.org\/. Last accessed September 2025."},{"key":"e_1_2_1_5_1","volume-title":"https:\/\/en.wikipedia.org\/wiki\/Log4Shell. Last accessed","year":"2025","unstructured":"2025. Log4Shell. https:\/\/en.wikipedia.org\/wiki\/Log4Shell. Last accessed September 2025."},{"key":"e_1_2_1_6_1","volume-title":"https:\/\/cwe.mitre.org\/data\/index.html. Last accessed","author":"List MITRE -CWE","year":"2025","unstructured":"2025. MITRE -CWE List. https:\/\/cwe.mitre.org\/data\/index.html. Last accessed September 2025."},{"key":"e_1_2_1_7_1","volume-title":"https:\/\/ollama.com. Last accessed","year":"2025","unstructured":"2025. Ollama. https:\/\/ollama.com. Last accessed September 2025."},{"key":"e_1_2_1_8_1","volume-title":"https:\/\/github.com\/defects4log\/SecLogging. Last accessed","author":"Package Replicaton","year":"2026","unstructured":"2026. Replicaton Package. https:\/\/github.com\/defects4log\/SecLogging. Last accessed April 2026."},{"key":"e_1_2_1_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/3715779"},{"key":"e_1_2_1_10_1","volume-title":"SDLog: A Deep Learning Framework for Detecting Sensitive Information in Software Logs. arXiv preprint arXiv:2505.14976","author":"Aghili Roozbeh","year":"2025","unstructured":"Roozbeh Aghili, Xingfang Wu, Foutse Khomh, and Heng Li. 2025. SDLog: A Deep Learning Framework for Detecting Sensitive Information in Software Logs. arXiv preprint arXiv:2505.14976 (2025)."},{"key":"e_1_2_1_11_1","doi-asserted-by":"publisher","DOI":"10.1109\/SP46214.2022.9833745"},{"key":"e_1_2_1_12_1","volume-title":"Thu-Trang Nguyen, Son Nguyen, and Hieu Dinh Vo.","author":"Bui Tuan-Dung","year":"2025","unstructured":"Tuan-Dung Bui, Thanh Trong Vu, Thu-Trang Nguyen, Son Nguyen, and Hieu Dinh Vo. 2025. Correctness Assessment of Code Generated by Large Language Models Using Internal Representations. arXiv preprint arXiv:2501.12934 (2025)."},{"key":"e_1_2_1_13_1","doi-asserted-by":"publisher","DOI":"10.7717\/peerj-cs.489"},{"key":"e_1_2_1_14_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE.2017.15"},{"key":"e_1_2_1_15_1","volume-title":"2016 IEEE International Conference of Online Analysis and Computing Science (ICOACS). IEEE, 155-159","author":"Chen Haoyu","year":"2016","unstructured":"Haoyu Chen, Shanshan Tu, Chunye Zhao, and Yongfeng Huang. 2016. Provenance cloud security auditing system based on log analysis. In 2016 IEEE International Conference of Online Analysis and Computing Science (ICOACS). IEEE, 155-159."},{"key":"e_1_2_1_16_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597503.3639085"},{"key":"e_1_2_1_17_1","volume-title":"SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarios. arXiv preprint arXiv:2509.22097","author":"Chen Junkai","year":"2025","unstructured":"Junkai Chen, Huihui Huang, Yunbo Lyu, Junwen An, Jieke Shi, Chengran Yang, Ting Zhang, Haoye Tian, Yikun Li, Zhenhao Li, Xin Zhou, Xing Hu, and David Lo. 2025. SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarios. arXiv preprint arXiv:2509.22097 (2025)."},{"key":"e_1_2_1_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/3728931"},{"key":"e_1_2_1_19_1","unstructured":"DeepSeek-AI Daya Guo Dejian Yang and et al. 2025. DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning."},{"key":"e_1_2_1_20_1","unstructured":"DeepSeek-AI Aixin Liu Bei Feng Bing Xue and et al. Wang. 2025. DeepSeek-V3 Technical Report."},{"key":"e_1_2_1_21_1","volume-title":"2023 IEEE\/ACM 45th International Conference on Software Engineering (ICSE). IEEE, 843-854","author":"Ding Zishuo","year":"2023","unstructured":"Zishuo Ding, Yiming Tang, Yang Li, Heng Li, and Weiyi Shang. 2023. On the temporal relations between logging and code. In 2023 IEEE\/ACM 45th International Conference on Software Engineering (ICSE). IEEE, 843-854."},{"key":"e_1_2_1_22_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE48619.2023.00079"},{"key":"e_1_2_1_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/3379597.3387501"},{"key":"e_1_2_1_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/2591062.2591175"},{"key":"e_1_2_1_25_1","unstructured":"Aaron Grattafiori Abhimanyu Dubey Abhinav Jauhri Abhinav Pandey and et al. 2024. The Llama 3 Herd of Models."},{"key":"e_1_2_1_26_1","doi-asserted-by":"publisher","unstructured":"Mehran Hassani Weiyi Shang Emad Shihab and Nikolaos Tsantalis. 2018. Studying and detecting log-related issues. Empirical Softw. Engg. (2018). doi:10.1007\/S10664-018-9603-Z 10.1007\/S10664-018-9603-Z","DOI":"10.1007\/S10664-018-9603-Z"},{"key":"e_1_2_1_27_1","volume-title":"Dong Jae Kim, et al","author":"Heng Yi Wen","year":"2024","unstructured":"Yi Wen Heng, Zeyang Ma, Zhenhao Li, Dong Jae Kim, et al. 2024. Studying and Benchmarking Large Language Models For Log Level Suggestion. arXiv preprint arXiv:2410.08499 (2024)."},{"key":"e_1_2_1_28_1","volume-title":"Assessing and Advancing Benchmarks for Evaluating Large Language Models in Software Engineering Tasks. arXiv preprint arXiv:2505.08903","author":"Hu Xing","year":"2025","unstructured":"Xing Hu, Feifei Niu, Junkai Chen, Xin Zhou, Junwei Zhang, Junda He, Xin Xia, and David Lo. 2025. Assessing and Advancing Benchmarks for Evaluating Large Language Models in Software Engineering Tasks. arXiv preprint arXiv:2505.08903 (2025)."},{"key":"e_1_2_1_29_1","doi-asserted-by":"publisher","DOI":"10.1145\/3510003.3510152"},{"key":"e_1_2_1_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/3643733"},{"key":"e_1_2_1_31_1","doi-asserted-by":"publisher","DOI":"10.1145\/3650212.3652123"},{"key":"e_1_2_1_32_1","unstructured":"Staffs Keele et al. 2007. Guidelines for performing systematic literature reviews in software engineering. Technical Report. Technical report ver. 2.3 ebse technical report. ebse."},{"key":"e_1_2_1_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/3629526.3645033"},{"key":"e_1_2_1_34_1","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2020.2970422"},{"key":"e_1_2_1_35_1","doi-asserted-by":"publisher","DOI":"10.1145\/3643754"},{"key":"e_1_2_1_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/3468264.3468597"},{"key":"e_1_2_1_37_1","doi-asserted-by":"publisher","DOI":"10.1109\/ASE56229.2023.00136"},{"key":"e_1_2_1_38_1","doi-asserted-by":"publisher","DOI":"10.1145\/3324884.3416636"},{"key":"e_1_2_1_39_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE"},{"key":"e_1_2_1_40_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE43902.2021.00131"},{"key":"e_1_2_1_41_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE48619.2023.00078"},{"key":"e_1_2_1_42_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597503.3623304"},{"key":"e_1_2_1_43_1","volume-title":"Dong Jae Kim, and Tse-Hsun Chen","author":"Ma Zeyang","year":"2024","unstructured":"Zeyang Ma, Dong Jae Kim, and Tse-Hsun Chen. 2024. LibreLog: Accurate and Efficient Unsupervised Log Parsing Using Open-Source Large Language Models. arXiv preprint arXiv:2408.01585 (2024)."},{"key":"e_1_2_1_44_1","volume-title":"Towards explainable vulnerability detection with large language models","author":"Mao Qiheng","year":"2025","unstructured":"Qiheng Mao, Zhenhao Li, Xing Hu, Kui Liu, Xin Xia, and Jianling Sun. 2025. Towards explainable vulnerability detection with large language models. IEEE Transactions on Software Engineering (2025)."},{"key":"e_1_2_1_45_1","doi-asserted-by":"publisher","DOI":"10.1145\/3510003.3511561"},{"key":"e_1_2_1_46_1","doi-asserted-by":"publisher","DOI":"10.11613\/BM.2012.031"},{"key":"e_1_2_1_47_1","doi-asserted-by":"publisher","DOI":"10.1109\/MS.2016.33"},{"key":"e_1_2_1_48_1","doi-asserted-by":"publisher","DOI":"10.3390\/app12157681"},{"key":"e_1_2_1_49_1","doi-asserted-by":"publisher","DOI":"10.1145\/3715727"},{"key":"e_1_2_1_50_1","unstructured":"Qwen An Yang Baosong Yang Beichen Zhang and et al. 2025. Qwen2.5 Technical Report."},{"key":"e_1_2_1_51_1","volume-title":"PEACE: Towards Efficient Project-Level Efficiency Optimization via Hybrid Code Editing. arXiv preprint arXiv:2510.17142","author":"Ren Xiaoxue","year":"2025","unstructured":"Xiaoxue Ren, Jun Wan, Yun Peng, Zhongxin Liu, Ming Liang, Dajun Chen, Wei Jiang, and Yong Li. 2025. PEACE: Towards Efficient Project-Level Efficiency Optimization via Hybrid Code Editing. arXiv preprint arXiv:2510.17142 (2025)."},{"key":"e_1_2_1_52_1","doi-asserted-by":"publisher","DOI":"10.1145\/3510003.3510205"},{"key":"e_1_2_1_53_1","doi-asserted-by":"publisher","DOI":"10.1109\/ASE63991.2025.00161"},{"key":"e_1_2_1_54_1","volume-title":"Proceedings of the IEEE\/ACM 48th International Conference on Software Engineering (ICSE).","author":"Wang Xin","year":"2026","unstructured":"Xin Wang, Zhenhao Li, and Zishuo Ding. 2026. LLM4Perf: Large Language Models Are Effective Samplers for Multi- Objective Performance Modeling. In Proceedings of the IEEE\/ACM 48th International Conference on Software Engineering (ICSE)."},{"key":"e_1_2_1_55_1","volume-title":"Nghi DQ Bui, Junnan Li, and Steven CH Hoi.","author":"Wang Yue","year":"2023","unstructured":"Yue Wang, Hung Le, Akhilesh Deepak Gotmare, Nghi DQ Bui, Junnan Li, and Steven CH Hoi. 2023. Codet5+: Open code large language models for code understanding and generation. arXiv preprint arXiv:2305.07922 (2023)."},{"key":"e_1_2_1_56_1","doi-asserted-by":"publisher","DOI":"10.1145\/2601248.2601268"},{"key":"e_1_2_1_57_1","doi-asserted-by":"publisher","DOI":"10.1145\/3691620.3694994"},{"key":"e_1_2_1_58_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597503.3623326"},{"key":"e_1_2_1_59_1","unstructured":"An Yang Anfeng Li Baosong Yang and et al. 2025. Qwen3 Technical Report."},{"key":"e_1_2_1_60_1","doi-asserted-by":"publisher","DOI":"10.1145\/3715736"},{"key":"e_1_2_1_61_1","doi-asserted-by":"publisher","DOI":"10.1145\/3715738"},{"key":"e_1_2_1_62_1","doi-asserted-by":"publisher","DOI":"10.1145\/3184407.3184416"},{"key":"e_1_2_1_63_1","doi-asserted-by":"publisher","DOI":"10.1007\/S10664-019-09748-Z"},{"key":"e_1_2_1_64_1","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2024.3470333"},{"key":"e_1_2_1_65_1","doi-asserted-by":"publisher","DOI":"10.1145\/3650212.3680359"},{"key":"e_1_2_1_66_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE.2012.6227202"},{"key":"e_1_2_1_67_1","doi-asserted-by":"publisher","DOI":"10.1109\/APSEC51365.2020.00058"},{"key":"e_1_2_1_68_1","doi-asserted-by":"publisher","DOI":"10.1145\/3731754"},{"key":"e_1_2_1_69_1","volume-title":"Beyond LLMs: An Exploration of Small Open-source Language Models in Logging Statement Generation. arXiv preprint arXiv:2505.16590","author":"Zhong Renyi","year":"2025","unstructured":"Renyi Zhong, Yichen Li, Guangba Yu, Wenwei Gu, Jinxi Kuang, Yintong Huo, and Michael R Lyu. 2025. Beyond LLMs: An Exploration of Small Open-source Language Models in Logging Statement Generation. arXiv preprint arXiv:2505.16590 (2025)."},{"key":"e_1_2_1_70_1","doi-asserted-by":"publisher","DOI":"10.1109\/SANER48275.2020.9054831"}],"container-title":["Proceedings of the ACM on Software Engineering"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3797129","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,6,30]],"date-time":"2026-06-30T18:39:41Z","timestamp":1782844781000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3797129"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,6,30]]},"references-count":70,"journal-issue":{"issue":"FSE","published-print":{"date-parts":[[2026,6,30]]}},"alternative-id":["10.1145\/3797129"],"URL":"https:\/\/doi.org\/10.1145\/3797129","relation":{},"ISSN":["2994-970X"],"issn-type":[{"value":"2994-970X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,6,30]]}}}