{"id":738,"date":"2011-02-27T12:17:57","date_gmt":"2011-02-27T03:17:57","guid":{"rendered":"http:\/\/www.lancard.com\/blog\/?p=738"},"modified":"2025-03-12T11:31:17","modified_gmt":"2025-03-12T02:31:17","slug":"cakephp-%e3%81%a7-debug-log-%e3%81%ab%e3%82%af%e3%82%a8%e3%83%aa%e3%82%92%e5%87%ba%e5%8a%9b%e3%81%99%e3%82%8b%e6%89%8b%e6%8a%9c%e3%81%8d%e7%89%88","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2011\/02\/27\/cakephp-%e3%81%a7-debug-log-%e3%81%ab%e3%82%af%e3%82%a8%e3%83%aa%e3%82%92%e5%87%ba%e5%8a%9b%e3%81%99%e3%82%8b%e6%89%8b%e6%8a%9c%e3%81%8d%e7%89%88\/","title":{"rendered":"CakePHP \u3067 debug.log \u306b\u30af\u30a8\u30ea\u3092\u51fa\u529b\u3059\u308b(\u624b\u629c\u304d\u7248)"},"content":{"rendered":"<p>\u30b7\u30a7\u30eb\u66f8\u3044\u3066\u308b\u6642\u3068\u304b Web \u3067\u3082 Ajax \u306e\u3068\u304d\u3068\u304b<\/p>\n<p>\u300c\u753b\u9762\u306b\u30af\u30a8\u30ea\u3060\u3055\u308c\u3066\u3082\u898b\u3048\u306a\u3044\u3057\u3001\u56f0\u308b\u301c\u300d<\/p>\n<p>\u3063\u3066\u3068\u304d\u3042\u308a\u307e\u3059\u3088\u306d\uff1f<\/p>\n<p>\u300c\u3064\u30fc\u304b\u3001\u306a\u3093\u3067\u753b\u9762\u306b\u3060\u3059\u3093\u3060\uff1f\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306b\u51fa\u3057\u3066\u304f\u308c\u308c\u3070\u3044\u3044\u306e\u306b \u300d<\/p>\n<p>\u3068\u304b\u601d\u3044\u307e\u305b\u3093\uff1f<\/p>\n<p>\u3067\u3001\u8abf\u3079\u305f\u3089\u307f\u306a\u3055\u3093DB\u306e\u30c9\u30e9\u30a4\u30d0\u3092\u62e1\u5f35\u3057\u3066\u5bfe\u5fdc\u3055\u308c\u3066\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u3067\u3059\u304c\u3001\u5e38\u306b\u30af\u30a8\u30ea\u3092\u30ed\u30b0\u306b\u66f8\u3044\u3066\u6b32\u3057\u3044\u308f\u3051\u3067\u3082\u306a\u3044\u3057\u3001\u30c9\u30e9\u30a4\u30d0\u62e1\u5f35\u3068\u304b\u9762\u5012\u3002<\/p>\n<p>\u30af\u30a8\u30ea\u3092\u753b\u9762\u306b\u3060\u3057\u3066\u308b\u3068\u3053\u3069\u3046\u306a\u3063\u3066\u308b\u306e\u304b\u306a\u3041\u3001\u3068\u601d\u3063\u3066\u8abf\u3079\u305f\u3089<\/p>\n<p>cake\/libs\/view\/elements\/sql_dump.ctp<\/p>\n<p>\u306b\u30b4\u30ea\u30b4\u30ea\u306b\u66f8\u3044\u3066\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u30de\u30cd\u3057\u3066app_model.php\u306b\u3067\u3082\u30e1\u30bd\u30c3\u30c9\u4f5c\u308c\u3070\u3044\u3044\u3093\u3058\u3083\u306a\u3044\u304b\u306a\u30fc\u3063\u3066\u3053\u3068\u3067\u3001\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre lang=\"Php\" line=\"1\">\n    \/**\n     * \u901a\u5e38\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u308b\u30ed\u30b0\u3092\u53d6\u5f97\u3057\u3066debug.log\u306b\u51fa\u529b\u3059\u308b\u3002\n     *\/\n    function sqlToLog(){\n        $db =& $this->getDataSource();\n        if ($db->isInterfaceSupported(&#039;getLog&#039;)){\n            $this->log($db->getLog(), LOG_DEBUG);\n        }\n    }\n<\/pre>\n<p>\u5143\u306e\u30ed\u30b0\u8868\u793a\u3068\u9055\u3063\u3066\u660e\u793a\u7684\u306b\u547c\u3073\u51fa\u3059\u3082\u306e\u306a\u306e\u3067getLog\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u78ba\u8a8d\u3068\u304b\u8981\u3089\u306a\u3044\u6c17\u304c\u3057\u307e\u3059\u304c\u3001\u4e00\u5fdc\u3002<\/p>\n<p>\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068 debug.log \u306b\u305d\u308c\u307e\u3067\u306b\u5b9f\u884c\u3055\u308c\u305f\u30af\u30a8\u30ea\u3084\u3089\u4ed8\u5e2f\u60c5\u5831(\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u3066\u307e\u3059\u3088\u306d)\u304c\u66f8\u304d\u51fa\u3055\u308c\u307e\u3059\u3002\u6ce8\u610f\u70b9\u3068\u3057\u3066\u3001\u753b\u9762\u306b\u51fa\u3059\u30c7\u30fc\u30bf\u3092\u6a2a\u53d6\u308a\u3057\u3066\u3044\u308b\u306e\u3067\u30ed\u30b0\u306b\u66f8\u304d\u51fa\u3055\u308c\u305f\u3082\u306e\u306f\u753b\u9762\u306b\u306f\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u914d\u5217\u3092 print_r \u3067\u51fa\u529b\u3057\u305f\u5f62\u5f0f\u306a\u306e\u3067\u898b\u3084\u3059\u304f\u306f\u306a\u3044\u3067\u3059\u304c\u3001\u307e\u3041\u3001\u5341\u5206\u304b\u306a\u3002<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F738&#038;t=CakePHP%20%E3%81%A7%20debug.log%20%E3%81%AB%E3%82%AF%E3%82%A8%E3%83%AA%E3%82%92%E5%87%BA%E5%8A%9B%E3%81%99%E3%82%8B%28%E6%89%8B%E6%8A%9C%E3%81%8D%E7%89%88%29&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F738&#038;p&#091;images&#093;&#091;0&#093;=&#038;p&#091;title&#093;=CakePHP%20%E3%81%A7%20debug.log%20%E3%81%AB%E3%82%AF%E3%82%A8%E3%83%AA%E3%82%92%E5%87%BA%E5%8A%9B%E3%81%99%E3%82%8B%28%E6%89%8B%E6%8A%9C%E3%81%8D%E7%89%88%29\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F738&#038;text=CakePHP%20%E3%81%A7%20debug.log%20%E3%81%AB%E3%82%AF%E3%82%A8%E3%83%AA%E3%82%92%E5%87%BA%E5%8A%9B%E3%81%99%E3%82%8B%28%E6%89%8B%E6%8A%9C%E3%81%8D%E7%89%88%29\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F738&#038;title=CakePHP%20%E3%81%A7%20debug.log%20%E3%81%AB%E3%82%AF%E3%82%A8%E3%83%AA%E3%82%92%E5%87%BA%E5%8A%9B%E3%81%99%E3%82%8B%28%E6%89%8B%E6%8A%9C%E3%81%8D%E7%89%88%29\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&#038;v=3&#038;t=CakePHP%20%E3%81%A7%20debug.log%20%E3%81%AB%E3%82%AF%E3%82%A8%E3%83%AA%E3%82%92%E5%87%BA%E5%8A%9B%E3%81%99%E3%82%8B%28%E6%89%8B%E6%8A%9C%E3%81%8D%E7%89%88%29&#038;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F738\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=CakePHP%20%E3%81%A7%20debug.log%20%E3%81%AB%E3%82%AF%E3%82%A8%E3%83%AA%E3%82%92%E5%87%BA%E5%8A%9B%E3%81%99%E3%82%8B%28%E6%89%8B%E6%8A%9C%E3%81%8D%E7%89%88%29&#038;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F738\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>\u30b7\u30a7\u30eb\u66f8\u3044\u3066\u308b\u6642\u3068\u304b Web \u3067\u3082 Ajax \u306e\u3068\u304d\u3068\u304b \u300c\u753b\u9762\u306b\u30af\u30a8\u30ea\u3060\u3055\u308c\u3066\u3082\u898b\u3048\u306a\u3044\u3057\u3001\u56f0\u308b\u301c\u300d \u3063\u3066\u3068\u304d\u3042\u308a\u307e\u3059\u3088\u306d\uff1f \u300c\u3064\u30fc\u304b\u3001\u306a\u3093\u3067\u753b\u9762\u306b\u3060\u3059\u3093\u3060\uff1f\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306b\u51fa\u3057\u3066\u304f\u308c\u308c\u3070\u3044\u3044\u306e\u306b \u300d \u3068\u304b\u601d\u3044\u307e\u305b\u3093\uff1f  [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[24],"class_list":["post-738","post","type-post","status-publish","format-standard","hentry","category-1","tag-cakephp"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=738"}],"version-history":[{"count":11,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/738\/revisions"}],"predecessor-version":[{"id":4796,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/738\/revisions\/4796"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}