OSGi LogService is not really intended for debugging. It is intended for alerting Operations about unexpected failure conditions arising in a production system.
Most developers, given a tool like SLF4J, produce far too verbose logging. Operations do not care about line numbers: they want to know about network failures, unauthorised login attempts, etc. OSG LogService is good for this because it allows great flexibility in collecting and reporting log messages. There is a place for both kinds of logging, and in fact many OSGi developers do use both Log Service *and* a low-level debug logging library like SLF4J. Neil On Thu, May 9, 2013 at 1:39 AM, Dan Miller <[email protected]> wrote: > thanks for the reply, Marcel! > > that really limits the usefulness of the osgi LogService. why would i use > that over slf4j, for example? > > > On Wed, May 8, 2013 at 5:18 PM, Marcel Offermans < > [email protected]> wrote: > >> On May 9, 2013, at 1:06 AM, Dan Miller <[email protected]> wrote: >> >> > I have installed the Log bundle into felix, and have implemented the >> > LogListener to output those logs to the console. I see that i can get a >> > reference to the bundle where the log originated, but can i get the >> > class/method/line number where the message was written to the log like >> > Log4j or the JavaLogger output in their messages? >> >> No. >> >> The only thing you can get is the Exception and its stack trace, if the >> original log call provided that. >> >> At best you could try writing your own implementation of LogService that, >> when a message is logged that does not include an exception, somehow adds a >> stack trace itself so you can later retrieve that (maybe with your own, >> custom exception that wraps that trace). >> >> Greetings, Marcel >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

