RE: possible Application Access Logging bug
Hi Alex, In RC1 we indeed removed the per-application access log in favor of a shared access log attached to the Component. This service only logs server-side accesses to the component (via server connectors) and writes them in an Apache-like format. The logger name used for this purpose it something like org.restlet.Component by default. Now, there is another type of logging used for code debugging (info, warnings, traces, etc.), based on the calls to getContext.getLogger(). Are you referring to this type of logging? For this one, the logger name used by applications is org.restlet.Application by default and can be changed using Context.setLogger(). As the default will be the same for all applications, I have just changed it to the canonical class name of the application (i.e. the qualified Application subclass name). If the application is an anonymous class, it doesn't have a canonical name and org.restlet.application will be used. Committed to SVN. Let me know if I have misunderstood your problem. Also, the error in the tutorial has been fixed in SVN and the update will appear online soon. Thanks for reporting it! Best regards, Jerome -Message d'origine- De : news [mailto:[EMAIL PROTECTED] De la part de Alex Combs Envoyé : mercredi 21 février 2007 20:24 À : discuss@restlet.tigris.org Objet : possible Application Access Logging bug Run into a bit of an issue: It seems that if I create an Application and attach it to a Component, the Application no longer makes use of the Component's access logger. I'm guessing this dates back to RC1 and the deprecation of Application's logService, but if this is the case, how do I go about re-enabling Access Logging for my Application? It's already nicely defined for my Component's logService, I just need a way to get Application to use it too. On a related note: The Tutorial's Section 7 should probably be updated, since you can't modify an Application's logService property anymore.
Re: possible Application Access Logging bug
In RC1 we indeed removed the per-application access log in favor of a shared access log attached to the Component. This service only logs server-side accesses to the component (via server connectors) and writes them in an Apache-like format. The logger name used for this purpose it something like org.restlet.Component by default. This is correct, in that this is the behavior that we WANT, but what I'm saying is that it's not the behavior we're GETTING. I currently have an Application attached to a Component's DefaultHost on URI (i.e. myComponent.getDefaultHost().attach(,myApplication) ), so all calls are going to the Application, but no AccessLog is being generated. I've come up with a workaround, and THIS causes the AccessLog to be generated, but as you said, it should be happening automatically accessLogFilter = new LogFilter(getContext(), getLogService()); getDefaultHost().attach(, accessLogFilter); accessLogFilter.setNext(myApplication);
RE: possible Application Access Logging bug
Hi Alex, That's correct, the Component.getLogService() method creates a default service if none was already set. I have just updated the Javadocs of the method with this: /** * Returns the global log service. On the first call, if no log service was * defined via the [EMAIL PROTECTED] #setLogService(LogService)} method, then a default * logger service is created. This default service is enabled by default and * has a logger name composed of the canonical name of the current * component's class or subclass, appended with the instance hash code * between parenthesis (eg. com.mycompany.MyComponent(1439)). * * @return The global log service. */ Best regards, Jerome -Message d'origine- De : news [mailto:[EMAIL PROTECTED] De la part de Alex Combs Envoyé : jeudi 22 février 2007 19:51 À : discuss@restlet.tigris.org Objet : Re: possible Application Access Logging bug Hmm, well I've found the reason. It was basically an artifact from the b20-rc4 migration. I was creating a new LogService with the desired names and doing component.setLogService(myLogService), but apparently the default log service had some special set up that the new one didn't that allowed calls to be sent to the accesslog. If you want to set it up that way, that's fine, I just think that the documentation should give some warning to people who think, like I did, that they could just swap out the LogService object at will.
possible Application Access Logging bug
Run into a bit of an issue: It seems that if I create an Application and attach it to a Component, the Application no longer makes use of the Component's access logger. I'm guessing this dates back to RC1 and the deprecation of Application's logService, but if this is the case, how do I go about re-enabling Access Logging for my Application? It's already nicely defined for my Component's logService, I just need a way to get Application to use it too. On a related note: The Tutorial's Section 7 should probably be updated, since you can't modify an Application's logService property anymore.