Hi,
Is there a way to use the access log functionality in LogService in a
Restlet/Spring application? A minimal Restlet application will log
accesses by default but when I add the Spring integration the access
logging stops. Since Spring seems to use commons-logging by default
I've tried to add SLF4J to direct all logging to Log4J. My pom.xml
contains these dependencies:
<!-- Logging -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>1.5.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.5.5</version>
</dependency>
And I've installed the SLF4JBridgeHandler by doing:
SLF4JBridgeHandler.install();
When I enable logging via Log4J on debug-level the closest I get to
access logging is:
08-11-11 13:32:37 restlet-spring-logging DEBUG
RestletFrameworkServlet:496 - Successfully completed request
08-11-11 13:32:37 restlet-spring-logging DEBUG
XmlWebApplicationContext:258 - Publishing event in context
[EMAIL PROTECTED]:
ServletRequestHandledEvent: url=[/restlet-spring-logging/hello];
client=[127.0.0.1]; method=[GET]; servlet=[Restlet Servlet];
session=[null]; user=[null]; time=[4ms]; status=[OK]
Is this the Spring-integration's default way of handling access
logging? I though I would try to use setLogService(new
LogService(true)) but I think I don't grasp the Component-concept when
working in a servlet-environment. My spring context looks like this:
<bean id="root" class="com.example.HelloApplication">
<property name="root" ref="resources"/>
</bean>
<bean id="resources" class="org.restlet.ext.spring.SpringRouter">
<property name="attachments">
<map>
<entry key="/hello" value="com.example.HelloResource"/>
</map>
</property>
</bean>
Is a Component implicitly created and how can I access it?
Best Regards
Gabriel Falkenberg