{"id":2446,"date":"2024-11-01T10:01:25","date_gmt":"2024-11-01T01:01:25","guid":{"rendered":"http:\/\/blog.moramcnt.com\/?p=2446"},"modified":"2024-11-01T10:01:25","modified_gmt":"2024-11-01T01:01:25","slug":"log4j2%ec%97%90%ec%84%9c-%ed%8a%b9%ec%a0%95-sql-%eb%ac%b8%ec%9e%a5-%eb%a1%9c%ea%b7%b8%ec%97%90%ec%84%9c-%ec%a0%9c%ea%b1%b0","status":"publish","type":"post","link":"http:\/\/blog.moramcnt.com\/?p=2446","title":{"rendered":"Log4j2\uc5d0\uc11c \ud2b9\uc815 SQL \ubb38\uc7a5 \ub85c\uadf8\uc5d0\uc11c \uc81c\uac70"},"content":{"rendered":"<p><strong>I. \ubaa9\ud45c<\/strong><\/p>\n<p>\ub2e4\ube44\uc774\uc2a4\ub97c \ud1b5\ud574 \uc8fc\uae30\uc801\uc73c\ub85c \ub370\uc774\ud130\uac00 \uc62c\ub77c\uc624\ub294\uacbd\uc6b0 \ub85c\uadf8\uc5d0 SQL\ubb38\uc7a5\uc744 \ub0a8\uacbc\uc744\ub54c \ud30c\uc77c\ud06c\uae30\ub3c4 \ud06c\uace0 \ub85c\uadf8\uc591\uc774 \ub9ce\uc544 \ub514\ubc84\uae45\ud558\uae30\uac00 \uc6a9\uc774\ud558\uc9c0 \uc54a\uc544 \ud2b9\uc815 SQL \ubb38\uc7a5\uc740 \ub85c\uadf8\uc5d0\uc11c \uae30\ub85d\ud558\uc9c0 \uc54a\ub3c4\ub85d \uc124\uc815\ud55c\ub2e4.<\/p>\n<p><strong>II. \uc5f0\uad6c\ubc0f \uac1c\ubc1c\ub0b4\uc6a9<\/strong><\/p>\n<p>1. Log4j2.xml \ud30c\uc77c\uc218\uc815<\/p>\n<p>xml \ud30c\uc77c\uc5d0\uc11c \uc544\ub798\uc640 \uac19\uc774 RegexFilter\ub97c \uc774\uc6a9\ud558\uc5ec &#8220;NOT_WRITE_LOG&#8221;\ub85c \uc2dc\uc791\ud558\ub294 \ub2e8\uc5b4\uac00 \uc788\uc73c\uba74 \ub85c\uadf8\ub97c \uae30\ub85d\ud558\uc9c0 \uc54a\ub3c4\ub85d \ud55c\ub2e4.<\/p>\n<p>&lt;RegexFilter regex=&#8221;(?s).*NOT_WRITE_LOG.*&#8221; onMatch=&#8221;DENY&#8221; onMismatch=&#8221;NEUTRAL&#8221;<\/p>\n<p>useRawMsg=&#8221;true&#8221; \/&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<table style=\"width: 100%; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<\/p>\n<p>&lt;Configuration xmlns=&#8221;http:\/\/logging.apache.org\/log4j\/2.0\/config&#8221;&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>(\uc0dd\ub7b5)<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;Loggers&gt;<\/p>\n<p>&lt;logger name=&#8221;jdbc.sqlonly&#8221; level=&#8221;${logLevel}&#8221; additivity=&#8221;false&#8221;&gt;<\/p>\n<p>&lt;RegexFilter regex=&#8221;(?s).*NOT_WRITE_LOG.*&#8221;<\/p>\n<p>onMatch=&#8221;DENY&#8221; onMismatch=&#8221;NEUTRAL&#8221; useRawMsg=&#8221;true&#8221; \/&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;AppenderRef ref=&#8221;console&#8221; \/&gt;<\/p>\n<p>&lt;AppenderRef ref=&#8221;appRollingFile&#8221; \/&gt;<\/p>\n<p>&lt;\/logger&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>(\uc0dd\ub7b5)<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;Root level=&#8221;${logLevel}&#8221;&gt;<\/p>\n<p>&lt;AppenderRef ref=&#8221;console&#8221; \/&gt;<\/p>\n<p>&lt;AppenderRef ref=&#8221;appRollingFile&#8221; \/&gt;<\/p>\n<p>&lt;\/Root&gt;<\/p>\n<p>&lt;\/Loggers&gt;<\/p>\n<p>&lt;\/Configuration&gt;<\/p>\n<p>&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>2. Mybatis \ucffc\ub9ac xml \ud30c\uc77c\uc5d0 \uc8fc\uc11d\uc73c\ub85c NOT_WRITE_LOG\u00a0 \ub9c8\ud0b9<\/p>\n<table style=\"width: 100%; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>&lt;insert id=&#8221;insertTest&#8221; parameterType=&#8221;xxx.XxxVO&#8221;&gt;<\/p>\n<p>\/* \ud14c\uc2a4\ud2b8\uc815\ubcf4 \uc0bd\uc785, NOT_WRITE_LOG : driver.location.insertTest *\/<\/p>\n<p>INSERT INTO AAAA(DRV_NO<\/p>\n<p>&lt;if test=&#8217;traceDt != null&#8217;&gt;, TRACE_DT&lt;\/if&gt;<\/p>\n<p>&lt;if test=&#8217;coordX != null and coordY != null&#8217;&gt;, COORD&lt;\/if&gt;<\/p>\n<p>(\uc0dd\ub7b5 )<\/p>\n<p>&lt;\/insert&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>III. \uacb0\ub860<\/strong><\/p>\n<p>\uc704\uc640 \uac19\uc774 \ucc98\ub9ac\ud558\uace0 \uc774\ud074\ub9bd\uc2a4\uc5d0\uc11c \ub3cc\ub824\ubcf4\uba74 \ud574\ub2f9 \ucffc\ub9ac\uac00 \ucd9c\ub825\ub418\uc9c0 \uc54a\ub294\uac83\uc744 \ud655\uc778\ud560\uc218 \uc788\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I. \ubaa9\ud45c \ub2e4\ube44\uc774\uc2a4\ub97c \ud1b5\ud574 \uc8fc\uae30\uc801\uc73c\ub85c \ub370\uc774\ud130\uac00 \uc62c\ub77c\uc624\ub294\uacbd\uc6b0 \ub85c\uadf8\uc5d0 SQL\ubb38\uc7a5\uc744 \ub0a8\uacbc\uc744\ub54c \ud30c\uc77c\ud06c\uae30\ub3c4 \ud06c\uace0 \ub85c\uadf8\uc591\uc774 \ub9ce\uc544 \ub514\ubc84\uae45\ud558\uae30\uac00 \uc6a9\uc774\ud558\uc9c0 \uc54a\uc544 \ud2b9\uc815 SQL \ubb38\uc7a5\uc740 \ub85c\uadf8\uc5d0\uc11c \uae30\ub85d\ud558\uc9c0 \uc54a\ub3c4\ub85d \uc124\uc815\ud55c\ub2e4. II. \uc5f0\uad6c\ubc0f \uac1c\ubc1c\ub0b4\uc6a9 1. Log4j2.xml \ud30c\uc77c\uc218\uc815 xml \ud30c\uc77c\uc5d0\uc11c \uc544\ub798\uc640 \uac19\uc774 RegexFilter\ub97c \uc774\uc6a9\ud558\uc5ec &#8220;NOT_WRITE_LOG&#8221;\ub85c \uc2dc\uc791\ud558\ub294 \ub2e8\uc5b4\uac00 \uc788\uc73c\uba74 \ub85c\uadf8\ub97c \uae30\ub85d\ud558\uc9c0 \uc54a\ub3c4\ub85d \ud55c\ub2e4. &lt;RegexFilter regex=&#8221;(?s).*NOT_WRITE_LOG.*&#8221; onMatch=&#8221;DENY&#8221; onMismatch=&#8221;NEUTRAL&#8221; useRawMsg=&#8221;true&#8221; \/&gt; &nbsp; &nbsp; &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[6,7],"tags":[149,319,320],"class_list":["post-2446","post","type-post","status-publish","format-standard","hentry","category-java","category-7","tag-log4j2","tag-sql","tag-320"],"_links":{"self":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2446"}],"version-history":[{"count":3,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2446\/revisions"}],"predecessor-version":[{"id":2449,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2446\/revisions\/2449"}],"wp:attachment":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2446"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}