Project

General

Profile

Logging for custom plugin

Luca Stucchi
Added almost 4 years ago

Hi there,

I am trying to understand if it's possible and how to separate log rows generated by all the custom components or plugins that I developed.

Now if I have a set of instruction like the ones below

   ...
   Logger log = Logger.getLogger(MyComponent.class.getName());
   log.severe("Interesting information to be logged");
   ...

I find my log in the tigase-console.log and that is not a bad thing.

But to better monitor the behavior of my custom written code, I would like to write a different log file, for example custom-components-and-plugins.log.

That could not be achieved (I think) just by adding

   --debug-packages = com.mycomponent

because I'd have this log in the tigase.log, right ? I'd want a brand new file to store the information logged by my components.

Is there a way to implement that ?

Thanks in advance,

Luca


Replies (2)

Added by Wojciech Kapcia TigaseTeam almost 4 years ago

This is simply a Java Logger and you can configure it to your own liking, adding custom Handlers and so forth, v. Logger

Added by Luca Stucchi almost 4 years ago

Thanks Wojciech,

I followed your suggestions, as always the easy way is the best way to follow !

All the best,

Luca

    (1-2/2)