Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
How to set logging level
April 19, 2021
11:39, EEST
Avatar
francesco.sgaramella@rold.com
Member
Members
Forum Posts: 6
Member Since:
July 15, 2020
sp_UserOfflineSmall Offline

Hello everybody,
I am using the java sdk to connect a java project to an opc-ua server to read data.
It works properly, but the opc-ua sdk logs way too much. Indeed, it logs at DEBUG level.
How can I change the logging level to WARNING? I need to do it programmatically via java.

Thanks in advance for your help.
Regards,
Francesco

April 19, 2021
12:15, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

The SDK uses SLF4J (http://www.slf4j.org/). That is a facade, that whatever compatible actual logging library then links to. This is to say, configuring that library is outside of the SDK and would depend on what logging library you decided to use in your application.

The samples do use Log4j1, since the SDK is Java 6+ (PubSub editions 8+) and that is basically the only one that works in Java 6. But that is just a sample, typically nowadays most applications use Log4j2 or logback. Thus you should check the documentation of the logging library your application uses. Some of them might have the option to do that at runtime, but that would depend on the lib. And as a note, just to be sure, you cannot change the level of a particular message, but normally you can configure per package or class what level of logging you wish to use. Typically the default is that nothing is logged, unless you specify it to some level, but depends on the lib.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
7 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

TimK: 41

Member Stats:

Guest Posters: 0

Members: 677

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1