Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » Custom appender for log4j(Need to add a bundle that contains a custom appender for log4j)
Custom appender for log4j [message #1793261] Thu, 02 August 2018 10:48 Go to next message
Vito Scornavacche is currently offline Vito ScornavaccheFriend
Messages: 14
Registered: February 2018
Junior Member
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 #1822338 is a reply to message #1793261] Wed, 04 March 2020 11:37 Go to previous messageGo to next message
Mario  Jaramillo is currently offline Mario JaramilloFriend
Messages: 1
Registered: March 2020
Junior Member
Hi Vito, i would ask to you, how did you solve this issue?
Re: Custom appender for log4j [message #1827891 is a reply to message #1822338] Tue, 26 May 2020 12:26 Go to previous message
Vito Scornavacche is currently offline Vito ScornavaccheFriend
Messages: 14
Registered: February 2018
Junior Member
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 12:28]

Report message to a moderator

Previous Topic:Integration with Hawkbit
Next Topic:Running Kura on WIndows
Goto Forum:
  


Current Time: Sat Apr 27 03:32:55 GMT 2024

Powered by FUDForum. Page generated in 0.03068 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top