Custom appender for log4j [message #1793261] |
Thu, 02 August 2018 06:48  |
Eclipse User |
|
|
|
Hi all,
I have a bundle OSGI containing a custom appender for log4j that send the messages with MQTT. I tried this appender with the emulator and i added a Fragment-Host: log4j in the Manifest of the bundle, which force the emulator to load the bundle before the loading of log4j. On this way the OSGI framework knows that the bundle of the custom appender is mandatory for the loading of the logger.
It works. Changing the Threshold of the custom appender to ERROR, all the errors of kura process are sended to the broker MQTT.
The problem is that when i try to put the dp of the bundle in a linux device doesn't works. Kura load the log4j before the bundle and can not find the class of the custom appender, because it is not loaded yet.
There is a way to set the priority of the OSGI bundles loading?
|
|
|
|
Re: Custom appender for log4j [message #1827891 is a reply to message #1822338] |
Tue, 26 May 2020 08:26  |
Eclipse User |
|
|
|
Hi Mario,
I did it a long time ago, so maybe I don't remember the details.
What I remember is that I did not upload the bundle as dp file, but as Jar. Copy the file in the package directory of Kura and change the config.ini file in order to load also the new Jar bundle.
In this way you can define the priority of the bundle and load it before the slf4j one.
I hope this helps you.
[Updated on: Tue, 26 May 2020 08:28] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.24164 seconds