locka99 / opcua

A client and server implementation of the OPC UA specification written in Rust
Mozilla Public License 2.0
496 stars 131 forks source link

[Help] How to disable logs from opcua library ? #128

Closed jigar88 closed 3 years ago

jigar88 commented 3 years ago

Thanks for creating this library. I am trying to set up logging for my application which uses this excellent OPCUA library. I am writing logs in a log file in /tmp folder. I am getting lots of logs from the library and filled up the instance space. Is there a way to disable the logs from this library or minimize it?

locka99 commented 3 years ago

The opcua library is just using the log facade and leaves filtering up to the host application and the logging implementation you chose for your own application.

So you'd have to see what logger crate you're using (e.g. log4rs) and refer to the documentation.

Most would have a way to set the logging level by module so if you're getting too much noise from opcua you can turn the level down or filter it out. Some might allow you to log to another file entirely but that's implementation specific and you'd have to read the docs.