MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    [MMM-NetworkScanner] disable logging

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    16 Posts 5 Posters 6.5k Views 6 Watching
    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.
    • binderthB Offline
      binderth
      last edited by

      I’m running MM in pm2 and therefore get mm-out.x.log files. Is there a way to disable the logging for MMM-NetworkScanner? Would be nice to have a trigger for logging.

      as I configured 30sec. interval I get this every 30sec! ;)

      MMM-NetworkScanner received SCAN_NETWORK
      MMM-NetworkScanner is scanning for mac addresses
      MMM-NetworkScanner is scanning for ip addresses [ { ipAddress: '192.168.xx.xx,
          name: 'S.',
          icon: 'mobile',
          online: false },
        { ipAddress: '192.168.xx.xx,
          name: 'A.',
          icon: 'mobile',
          online: false },
        { ipAddress: '192.168.xx.xx,
          name: 'T.',
          icon: 'mobile',
          online: true,
          lastSeen: '2017-02-17T12:44:27.577Z' },
        { ipAddress: '192.168.xx.xx,
          name: 'D.',
          icon: 'mobile',
          online: true,
          lastSeen: '2017-02-17T12:44:27.578Z' } ]
      
      1 Reply Last reply Reply Quote 0
      • pugslyP Offline
        pugsly
        last edited by

        Just noticed this myself, that the pm2 logs were getting huge. I scan every 10 seconds, and all those scans were being logged.

        Only running on a 8GB SD card

        binderthB 1 Reply Last reply Reply Quote 1
        • binderthB Offline
          binderth @pugsly
          last edited by

          @pugsly said in [MMM-NetworkScanner] disable logging:

          Only running on a 8GB SD card

          got a 16GB, but still! ;) You could activate a logrotation in pm2:

          $ pm2 install pm2-logrotate
          
          pugslyP 1 Reply Last reply Reply Quote 0
          • pugslyP Offline
            pugsly @binderth
            last edited by

            @binderth Im guessing that this somehow rotates or makes new logs for anything running on pm2?

            Any config steps for this besides just installing it?

            binderthB 1 Reply Last reply Reply Quote 0
            • binderthB Offline
              binderth @pugsly
              last edited by binderth

              @pugsly jepp, this rotates the log (like Linux-logs or log4j): have a look here:
              https://www.npmjs.com/package/pm2-logrotate

              this eliminates the need to buy a new SD Card every month (just kidding), but leaves the initial problem open: how can I remove those log-entries, because if I don’t Need them after setup, they’re just filling the log, leaving me scrolling for other stuff I need to have a look at while debugging or whatever. Perhaps there is a switch, but I don’t see it…

              1 Reply Last reply Reply Quote 0
              • I Offline
                ianperrin
                last edited by ianperrin

                @binderth, @pugsly

                There is a (currently undocumented) debug config option in the module which minimises the logging. By default it should be set to false, but you can explicitly set it yourself

                i.e. debug: false,

                In earlier versions it had little effect, but in the latest commit, it should significantly reduce the volume of logging.

                See how it goes

                "Live as if you were to die tomorrow. Learn as if you were to live forever." - Mahatma Gandhi

                binderthB 1 Reply Last reply Reply Quote 1
                • binderthB Offline
                  binderth @ianperrin
                  last edited by binderth

                  @ianperrin I don’t get anymore logging from MMM-Networkscanner after git pull & npm install, but I also don’t get to see my devices, they all seem offline.

                  		{
                  			module: 'MMM-NetworkScanner',
                  			position: 'top_right',
                  			header: 'Binder Handys',
                  			config: {
                  				devices: [
                  					{ ipAddress: "192.168.xx.x", name: "S", icon: "mobile"},
                   					{ ipAddress: "192.168.xx.x", name: "A", icon: "mobile"},
                  					{ ipAddress: "192.168.xx.x", name: "T", icon: "mobile"},
                   					{ ipAddress: "192.168.xx.x", name: "D", icon: "mobile"},
                  					],
                  					showUnknown: false,
                  					showOffline: true,
                  					showLastSeen: false,
                  					keepAlive: 180,
                  					debug: false,
                  					updateInterval: 30,
                  				}        
                  		},
                  

                  in the mm-out-0.log:

                  Connecting socket for: MMM-NetworkScanner
                  Starting module: MMM-NetworkScanner
                  (...)
                  MMM-NetworkScanner received CONFIG
                  

                  edit:
                  after changing debug: true, in the config and pm2 restart mm I experience the same behaviour.
                  after deleting the debug-line completely, nothing changes also.

                  I Mykle1M 2 Replies Last reply Reply Quote 0
                  • I Offline
                    ianperrin @binderth
                    last edited by

                    @binderth

                    Did you restart the mirror after the upgrade?
                    Are there any errors in the browser console?
                    What happens if debug is set to true?

                    "Live as if you were to die tomorrow. Learn as if you were to live forever." - Mahatma Gandhi

                    binderthB 1 Reply Last reply Reply Quote 1
                    • binderthB Offline
                      binderth @ianperrin
                      last edited by binderth

                      @ianperrin said in [MMM-NetworkScanner] disable logging:

                      Did you restart the mirror after the upgrade?
                      Are there any errors in the browser console?
                      What happens if debug is set to true?

                      as described, I did a pm2 restart mm, the behaviour is the same if debug: true as described.

                      the browser console re MMM-NetworkScanner:

                      loader.js:182 Load script: modules/MMM-NetworkScanner//MMM-NetworkScanner.js
                      module.js:415 Module registered: MMM-NetworkScanner
                      loader.js:152 Bootstrapping module: MMM-NetworkScanner
                      loader.js:227 File already loaded: moment.js
                      loader.js:157 Scripts loaded for: MMM-NetworkScanner
                      loader.js:227 File already loaded: font-awesome.css
                      loader.js:159 Styles loaded for: MMM-NetworkScanner
                      loader.js:161 Translations loaded for: MMM-NetworkScanner
                      (...)
                      MMM-NetworkScanner.js:32 Starting module: MMM-NetworkScanner
                      (...)
                      module.js:117 MMM-NetworkScanner received a system notification: ALL_MODULES_STARTED
                      (...)
                      module.js:117 MMM-NetworkScanner received a system notification: DOM_OBJECTS_CREATED
                      (...)
                      module.js:115 MMM-NetworkScanner received a module notification: CURRENTWEATHER_DATA from sender: currentweather
                      (...)
                      module.js:115 MMM-NetworkScanner received a module notification: CALENDAR_EVENTS from sender: calendar
                      (...)
                      

                      still, all devices are shown offline:
                      0_1487415081291_upload-a204f2e9-3ec0-474c-9bf4-f8d6a2eac761

                      hth! Thanks for your effort!

                      1 Reply Last reply Reply Quote 0
                      • Mykle1M Offline
                        Mykle1 Project Sponsor Module Developer @binderth
                        last edited by

                        @binderth said in [MMM-NetworkScanner] disable logging:

                        MMM-NetworkScanner received CONFIG

                        This started happening yesterday to me, too. Now only macAddress works. ipAddress no longer works. And it used to work perfectly. I started a new topic. Forgive me for that. I was in a panic. Still am.

                        MMM-NetworkScanner received CONFIG

                        Create a working config
                        How to add modules

                        Mykle1M 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Sam, technical setup by Karsten.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy