You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

Hi,
I tried configuring loggers in one of the pax.logging.cfg file, java.util.logging.properties files as below-
log4j.logger.com.mypackage.MyApp=DEBUG, out, stdout
in talend route java code-
org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(MyApp.class);
log.warn("sample log message");
the above statement does not log at any level ( WARN, DEBUG). Any idea? I get no logging errors as well ![]()
Also tried installing tlog4j and tlogcatcher components but, they found to be not available in Mediation view.
Offline

Did you test inside the Talend Runtime (OSGi) or outside? Inside the Talend Runtime it should just work. You should not even need to adjust the logging config as you are using .warn which should always be logged.
Offline

I tested inside osgi container. I can see that loggers are working if implemented by -
org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(MyApp.class);
if(log.isWarnEnabled())
log.warn("sample log message");
but, I want it with org.slf4j.Logger as I am using some talend components that implement the logger this way. Are there any jars I am missing?
I already put sl4j-api-1.6.1, sl4j-log4j-1.6.1, common-logging.jar, log4j-1.2.16.jar in cconfig.
I also tried without configuring the properties and without jars. This way, sl4j is defaulting to NOP implementation.
Last edited by vnodkmar (2012-06-25 13:16:45)
Offline

The problem may be exactly that you put the slf4j api in the config. As far as I know that means it is embedded into the jar. Probably that makes the slf4j invisble for pax logging. You can check the resulting jar of your route. It should not embed slf4j api and instead have an Import-Package for it.
Offline

I also saw that. I checked with the the dev team for the tooling. Currently it does not seem to be possible to use slf4j.
They are working on a solution. I hope we can at least add the import package statements to the manifest for the next bugfix release. For the longer term it is planned to allow users to specify their own imports.
Offline

hmm, I don't seem to have any problem using slf4j within a cbean in 5.1.1. I assume the same would be true using routes developed with beans that were developed in Eclipse and imported into a Talend project I've attached links to a sample route (very trivial) that uses sl4j with log4j. It runs it both Studio and ESB runtime without problems. Perhaps I am misunderstanding the problem?
Here is the exported route http://eost.net/eost/slf4jTest/slf4jTest.zip
Offline
Pages: 1