0 Replies Latest reply on May 28, 2010 11:08 AM by freeze

    How to use logger comfortably

    freeze

      Hi !

       

      I wonder what is the best way to use OSGI logger in order to have my log messsages in karaf log and "log:display". I know that there exists LogService but I don't know the elegant way to use it.

       

      Shall I obtain its ServiceReference in every class of my bundle or rather create one class with static field for the logger? Both solutions seem ugly to me and the first one is even not always feasible. I have found some solutions redirecting the standard loggers output to servicemix log:display but none of them was simple.

       

      Would you have any suggestions? I need very simple functionality... Just appending log messages from any place in my code easily..

       

      best,

      Peter