Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
How disable logging
-
Hello,
It may seem like a stupid question but can anyone give me a hand?
I tried to disable the logging without any progress.
I tried put the commons-logging.properties in jar file.
Also, adding -Dcom.serotonin.modbus4j.ip.tcp.TcpMaster.level=INFO to JVM
or adding the setting at /lib/logging.properties
None of them works.How do you configure the logging?
-
You are looking for Mango/classes/log4j.xml
Down near the bottom of the file are <category /> configurations for individual packages. I think you can eliminate essentially all logging by commenting that stanza out ( <!-- .... --> )
-
Hi phildunlap,
Thank you but I still don't get it.
I build from source and got "Modbus4J\target\release\modbus4j-3.0.1.jar"
In that jar, there is no log4j.xml.I tried to add log4j.xml, log4j.properties, common-logging.properties into modbus4j-3.0.1.jar but the debug log still show up. Orz
said:
log4j.xml
-
Hi Karateboy,
My mistake, I didn't see this was in the Modbus4J section, I gave the normal Mango answer.
When you placed common-logging.properties somewhere, that file was unique and on the classpath, correct?
I have not attempted what you are describing so I am guessing here... Looking at how Mango initializes its logging, it seems to me if you've got the commons-logging jar, the log jar and the log4j jar on the classpath, you should be able to configure it with a log4j.xml file being on the classpath too. There is probably a better way to init the LoggingFactory if you're only use of it is in the Modbus4J classes. Perhaps someone else could be more useful.