• Recent
    • Tags
    • Popular
    • Register
    • Login

    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.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    How disable logging

    Modbus4J general discussion
    2
    4
    2.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      karateboy
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        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 ( <!-- .... --> )

        1 Reply Last reply Reply Quote 0
        • K
          karateboy
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • phildunlapP
            phildunlap
            last edited by phildunlap

            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.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post