-
Bundle logging
Hi,
I've got a bundle containing only one bean using SLF4J API for logging. In the bean implementation, there's a method list() with logger.info("Message") call in it. This method is called from bean init method (invoked by Spring on context startup) and is also exposed as @ManagedOperation.
I've noticed that when this bundle is started, log statement "Message" appears in bundle speficic trace.log as well as in S2AP trace.log. However, when I invoke the operation using JConsole, the statement is printed to S2AP trace.log only.
Any idea how to solve this logging issue? Thanks.
Jaro
-
Bundle logging
Hi,
I have a similar problem in a web module: in my @Controller class I log a message in the constructor (invoked by spring on startup) and in a method that is invoked on a request (marked with @RequestMapping). The message from the constructor is logged to both the global and the application trace file. The log message from the request method only appears in the global trace file.
I've tried SL4J and Commons logging (in both cases using Import-Package) and deployed my web module standalone and as part of a PAR file. The result is always the same.
The application's trace file stopps in any case after initializing the DispatcherServlet:
[...]
[2008-08-22 13:09:34.062] async-delivery-thread-1 nerBase.[springsource.platform.catalina].[localhost].[/].unknown I Initializing Spring FrameworkServlet 'org.test.webapp-DispatcherServlet'
[2008-08-22 13:09:34.062] async-delivery-thread-1 org.springframework.web.servlet.DispatcherServlet. unknown I FrameworkServlet 'org.test.webapp-DispatcherServlet': initialization started
[2008-08-22 13:09:34.140] async-delivery-thread-1 org.springframework.web.servlet.DispatcherServlet. unknown I FrameworkServlet 'org.test.webapp-DispatcherServlet': initialization completed in 78 ms
Any ideas what's going wrong?
Thanks,
Nils
-
Bundle logging
Jaro,
The Platform should detect the MBeanExporter that's configured in your application context and automatically replace it with a Platform-specific one that will export MBeans that route the trace correctly when they're invoked.
The behaviour that you've described is at odds with this so you may have found a bug. Can you please raise a JIRA issue for this, and attach your application context XML file and a trace.log file that covers the deployment of your bundle.
Thanks,
Andy
-
Bundle logging
Hi Nils,
This should work, so can you please open a JIRA? Also, it'd be a great help if you could attach an application that illustrates the problem to the JIRA.
Thanks,
Andy
-
Bundle logging
Hi Andy,
thanks for your response. I've created an issue: https://issuetracker.springsource.com/browse/PLATFORM-164
BTW: The problem only occures when the Web-ContextPath is set to "/". In any other case it seems to log correctly to both files.
Regards,
Nils
-
Bundle logging
Thanks, Nils. I'm looking at it now.
-
Bundle logging
Hi Andy,
Issue raised: https://issuetracker.springsource.com/browse/PLATFORM-166
Regards
Jaro