[{"data":1,"prerenderedAt":217},["ShallowReactive",2],{"article-\u002Fblog\u002Fspa-db-aduit":3},{"id":4,"title":5,"author":6,"body":7,"description":202,"extension":203,"intro":204,"meta":205,"name":204,"navigation":207,"path":208,"pubDate":209,"role":204,"seo":210,"stem":211,"tags":212,"__hash__":216},"content\u002Fblog\u002Fspa-db-aduit.md","Turn off DB_AUDIT Logs in SAP Commerce","Danny Krämer",{"type":8,"value":9,"toc":200},"minimark",[10,23,34,44,57,64,90,96,110,116,182,196],[11,12,13,14,18,19,22],"p",{},"SAP Commerce's database audit logging can get really annoying. Every database interaction creates a ",[15,16,17],"code",{},"DB_AUDIT"," log from the ",[15,20,21],{},"AuditbaleActionsHandler",". Especially, if you want to debug a database heavy class, it can get really hard to find your beloved debug logs in between all the audit logs. But turning off the audit logs isn't that easy.",[11,24,25,26,33],{},"I found ",[27,28,32],"a",{"href":29,"rel":30},"https:\u002F\u002Fcommunity.sap.com\u002Ft5\u002Fcrm-and-cx-blogs-by-members\u002Faudit-data-and-audit-logging-in-sap-commerce\u002Fba-p\u002F13738362",[31],"nofollow","this article about audit logging",". It suggests to set the following properties:",[35,36,41],"pre",{"className":37,"code":39,"language":40},[38],"language-text","log4j2.logger.auditableActionsHandler.name=de.hybris.platform.audit.actions.impl.Slf4jAuditableActionHandler\nlog4j2.logger.auditableActionsHandler.level=OFF\n","text",[15,42,39],{"__ignoreMap":43},"",[11,45,46,47,50,51,56],{},"That did not work for me. Even after setting the properties in my ",[15,48,49],{},"local.properties"," I got all the logs. Also editing the Log4J config did not work. Then I found ",[27,52,55],{"href":53,"rel":54},"https:\u002F\u002Fme.sap.com\u002Fnotes\u002F3342126\u002FE",[31],"this note"," from SAP. The only thing that seems to work is to turn off the logging for every item type. But how do you know which types to set? Here is an easy step by step solution.",[58,59,60],"ol",{},[61,62,63],"li",{},"You need to install xmlstarlet",[35,65,69],{"className":66,"code":67,"language":68,"meta":43,"style":43},"language-bash shiki shiki-themes github-dark github-light","sudo apt install xmlstarlet\n","bash",[15,70,71],{"__ignoreMap":43},[72,73,76,80,84,87],"span",{"class":74,"line":75},"line",1,[72,77,79],{"class":78},"s-Z4r","sudo",[72,81,83],{"class":82},"sg6BJ"," apt",[72,85,86],{"class":82}," install",[72,88,89],{"class":82}," xmlstarlet\n",[58,91,93],{"start":92},2,[61,94,95],{},"Go to your source",[35,97,99],{"className":66,"code":98,"language":68,"meta":43,"style":43},"cd path\u002Fto\u002Fhybris\u002Fbin  \n",[15,100,101],{"__ignoreMap":43},[72,102,103,107],{"class":74,"line":75},[72,104,106],{"class":105},"s0DvM","cd",[72,108,109],{"class":82}," path\u002Fto\u002Fhybris\u002Fbin\n",[58,111,113],{"start":112},3,[61,114,115],{},"Find all item types that are enabled for database audit logging.",[35,117,119],{"className":66,"code":118,"language":68,"meta":43,"style":43},"find . -name \"*-items.xml\" | xargs xmlstarlet select -t -m \"\u002F\u002Fitemtype\" -n -v \"concat(concat('dbaudit.', @code), '.disabled=true')\" | sort | uniq > dbaudit.txt\n",[15,120,121],{"__ignoreMap":43},[72,122,123,126,129,132,135,139,142,145,148,151,154,157,160,163,166,168,171,173,176,179],{"class":74,"line":75},[72,124,125],{"class":78},"find",[72,127,128],{"class":82}," .",[72,130,131],{"class":105}," -name",[72,133,134],{"class":82}," \"*-items.xml\"",[72,136,138],{"class":137},"scx8i"," |",[72,140,141],{"class":78}," xargs",[72,143,144],{"class":82}," xmlstarlet",[72,146,147],{"class":82}," select",[72,149,150],{"class":105}," -t",[72,152,153],{"class":105}," -m",[72,155,156],{"class":82}," \"\u002F\u002Fitemtype\"",[72,158,159],{"class":105}," -n",[72,161,162],{"class":105}," -v",[72,164,165],{"class":82}," \"concat(concat('dbaudit.', @code), '.disabled=true')\"",[72,167,138],{"class":137},[72,169,170],{"class":78}," sort",[72,172,138],{"class":137},[72,174,175],{"class":78}," uniq",[72,177,178],{"class":137}," >",[72,180,181],{"class":82}," dbaudit.txt\n",[11,183,184,185,188,189,192,193,195],{},"You will get a text file ",[15,186,187],{},"dbaudit.txt"," with all item types and the ",[15,190,191],{},"dbaudit.\u003Citemtype>.disbaled"," property set to true. Now, turn everything into lower case, and put them into your ",[15,194,49],{},". Voila! The logging is gone.",[197,198,199],"style",{},"html pre.shiki code .s-Z4r, html code.shiki .s-Z4r{--shiki-dark:#B392F0;--shiki-default:#6F42C1}html pre.shiki code .sg6BJ, html code.shiki .sg6BJ{--shiki-dark:#9ECBFF;--shiki-default:#032F62}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .s0DvM, html code.shiki .s0DvM{--shiki-dark:#79B8FF;--shiki-default:#005CC5}html pre.shiki code .scx8i, html code.shiki .scx8i{--shiki-dark:#F97583;--shiki-default:#D73A49}",{"title":43,"searchDepth":92,"depth":92,"links":201},[],"The databse audit logging of SAP Commerce can fill up your logs. Then it is hard to use logs for debugging. This article covers how you can turn off the logging for local development.","md",null,{"image":206},{"url":43,"alt":43},true,"\u002Fblog\u002Fspa-db-aduit","2024-11-22",{"title":5,"description":202},"blog\u002Fspa-db-aduit",[213,214,215],"sap commerce","software development","configuration","8_IzlAecsNzzytI9_A_xBZPGMrreMgkJlsvuVu1eOUo",1775933922309]