Please consider registering

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
Forum Posts: 3
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.

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


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: 267

Currently Online:
8 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 109

pramanj: 86

ibrahim: 71

kapsl: 57

gjevremovic: 49

TimK: 41

fred: 41

Fransua33: 39

Xavier: 34

rocket science: 33

Member Stats:

Guest Posters: 0

Members: 1302

Moderators: 15

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1106

Posts: 4680

Newest Members:

keremcoban, hypnos97, ekosunen40, janellbusby73, huey6201719746, hildanott654389, laurenemay, aman79, dawnpreciado138, daltondoughty96

Moderators: Jouni Aro: 877, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 642, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Teppo Uimonen: 21, Markus Johansson: 30, Matti Siponen: 100, Lusetti: 0

Administrators: admin: 1