{"comment":{"created_at":"2011-10-17T15:50:52Z","body":"Supplying a toString() method to lang.reflect.Proxy is not a good\nidea, it should be treated just as any other method and be proxied\nto the invocation handler - I'd suggest to remove this from the\npatch and create a new RFC instead!\n\nSame goes for hashCode() and equals(), btw...\n\n\nfriebe, Mon, 14 Aug 2006 16:39:17 +0200","updated_at":"2011-10-17T15:50:52Z","url":"https://api.github.com/repos/xp-framework/rfc/issues/comments/2430556","id":2430556,"user":{"gravatar_id":"26f07e3b262e9a80436f368cb11bd0c2","avatar_url":"https://secure.gravatar.com/avatar/26f07e3b262e9a80436f368cb11bd0c2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/thekid","id":696742,"login":"thekid"}},"action":"created","issue":{"number":67,"created_at":"2011-10-17T15:50:43Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Scope of Change\n====\nA new function setTrace() will be added to the class remote.Remote which\ncan be used to specify a util.LogCategory for logging requests and\nresponses.\n\n\nRationale\n====\nCurrently it's very hard to debug the requests/responses between PHP\nclient and EASC server. To ease the debugging process, it should be\npossible to set a LogCategory which is used for logging all requests\nand responses.\n\n\nFunctionality\n====\nSetting a trace for remote.Remote class should go like this:\n\n```php\n<?php\n  $url= 'xp://jboss01.example.com/';\n  \n  $l= &Logger::getInstance();\n  $pool= &HandlerInstancePool::getInstance();\n  $handler= &$pool->acquire($url);\n  $handler->setTrace($l->getCategory());\n\n  try(); {\n    $remote= &Remote::forName($url);\n  } if (catch('RemoteException', $e)) {\n    return throw($e);\n  }\n  \n  // Proceed with invoking some stuff\n  ...\n?>\n```\n\nExample logged output:\n\n```php\n<?php\n[10:48:40 32525 debug] >>> remote.protocol.XpProtocolHandler(pimperator4.schlund.de:6448) echoHash([\n  0 => [\n    localpart => \"xp\"\n    domain => \"php3.de\"\n  ]\n])\n[10:48:40 32525 debug] <<< [\n  localpart => \"xp\"\n  domain => \"php3.de\"\n]\n?>\n```\n\nThe string representation of the passed parameters and the represenation\nof the reponse is generated using xp::stringOf() function.\n\nA more detailed logging would also be possible which shows the RAW data\nsent between client and server:\n\n```php\n<?php\n[09:43:12 9089 debug] >>> remote.protocol.XpProtocolHandler(pimperator4.schlund.de:6448) LOOKUP xp/demo/Roundtrip\n[09:43:12 9089 debug] >>> Request: [\n  0 => xp/demo/Roundtrip\n]\n[09:43:12 9089 debug] <<< Response: I:3479658:{s:46:\"net.xp_framework.beans.stateless.RoundtripHome\";}\n[09:43:12 9089 debug] <<< Proxy·0(handler= remote.RemoteInvocationHandler)\n[09:43:12 9089 debug] >>> remote.protocol.XpProtocolHandler(pimperator4.schlund.de:6448) 3479658::create([\n])\n[09:43:12 9089 debug] >>> Request: [\n  0 => create\n  1 => A:0:{}\n]\n[09:43:12 9089 debug] <<< Response: I:1757497:{s:42:\"net.xp_framework.beans.stateless.Roundtrip\";}\n[09:43:12 9089 debug] <<< Proxy·1(handler= remote.RemoteInvocationHandler)\n[09:43:12 9089 debug] >>> remote.protocol.XpProtocolHandler(pimperator4.schlund.de:6448) 1757497::echoHash([\n  0 => [\n    localpart => \"xp\"\n    domain => \"php3.de\"\n  ]\n])\n[09:43:12 9089 debug] >>> Request: [\n  0 => echoHash\n  1 => A:1:{a:2:{s:9:\"localpart\";s:2:\"xp\";s:6:\"domain\";s:7:\"php3.de\";}}\n]\n[09:43:12 9089 debug] <<< Response: a:2:{s:9:\"localpart\";s:2:\"xp\";s:6:\"domain\";s:7:\"php3.de\";}\n[09:43:12 9089 debug] <<< [\n  localpart => \"xp\"\n  domain => \"php3.de\"\n]\n?>\n```\n\nSecurity considerations\n====\nn/a\n\n\nSpeed impact\n====\nSlight performance issues while setting and checking the LogCategory and\nwhile logging stuff.\n\n\nDependencies\n====\nn/a\n\n\nRelated documents\n====\nn/a\n\n\n","comments":9,"title":"Add debug logging to remote API","updated_at":"2011-10-17T15:50:52Z","url":"https://api.github.com/repos/xp-framework/rfc/issues/67","id":1930092,"assignee":null,"milestone":null,"closed_at":"2011-10-17T15:50:44Z","user":{"gravatar_id":"26f07e3b262e9a80436f368cb11bd0c2","avatar_url":"https://secure.gravatar.com/avatar/26f07e3b262e9a80436f368cb11bd0c2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/thekid","id":696742,"login":"thekid"},"html_url":"https://github.com/xp-framework/rfc/issues/67","labels":[{"name":"framework","url":"https://api.github.com/repos/xp-framework/rfc/labels/framework","color":"118f5b"},{"name":"implemented","url":"https://api.github.com/repos/xp-framework/rfc/labels/implemented","color":"807370"}],"state":"closed"},"legacy":{"issue_id":1930092,"comment_id":2430556}}