Reputation: 13
I´m trying to get an output into my console, but it does not work. I have the following example code:
package org.eclipse.kura.example.hello_osgi;
import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class HelloOsgi {
private static final Logger s_logger = LoggerFactory.getLogger(HelloOsgi.class);
private static final String APP_ID = "org.eclipse.kura.example.hello_osgi";
protected void activate(ComponentContext componentContext) {
s_logger.info("Bundle " + APP_ID + " has started!");
//console should view this
s_logger.debug(APP_ID + ": This is a debug message.");
}
protected void deactivate(ComponentContext componentContext) {
s_logger.info("Bundle " + APP_ID + " has stopped!");
}
}
Console output:
...
ss
"Framework is launched."
osgi> install file:/Users/myname/eclipseworkspace/org.eclipse.kura.example.hello_osgi
undle id is 1023
osgi> start 1023
1023 ACTIVE org.eclipse.kura.example.hello_osgi_1.0.0.qualifier
osgi> ((HERE SHOULD BE MY TEXT))
In addition, let me tell you that to handle with Kura and OSGi is still new to me. But I think the question alone makes that clear enough. :D
Thanks in advance folks.
Upvotes: 1
Views: 273
Reputation: 461
The log output does not go to the OSGi console, it goes to the Kura log file. You should see your output in /var/log/kura.log.
Upvotes: 1