Announcement

Collapse
No announcement yet.

Is Mono logging in daemon.log and syslog?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Is Mono logging in daemon.log and syslog?

    I'm a bit new to the Linux environment but manage to get most of what I need through Googling and reading loads of information.
    But.. I can't figure this one out.

    I'm tailing daemon.log (which is growing rapidly by the way - currently at 4GB and have been growing since June 3 -2021) and I just deleted the old daemon.log.1 which was about 17GB. Also tailing syslog which is about 4GB as well.

    Both log files seems to be getting information intended for Homeseer logging.

    Below is just a few lines. It fills quickly.. Adding a few lines per second.
    Don't focus on the content of what what's happening in the Homeseer environment per se.. The intention was to show that it looks to me as if mono is logging information to both daemon.log and syslog. Both files get the same information logged.

    EXAMPLE OF LOG:
    Jun 18 02:25:01 raspberrypi mono[477]: 02:25:01:6008:[Z-Wave]->ApplicationCommandHandler from Network: E9DC3BB6 Node: 52 HANDLING: COMMAND_CLASS_MULTI_CHANNEL_V2 Frame(7)=13
    Jun 18 02:25:01 raspberrypi mono[477]: 02:25:01:6079:[Z-Wave]->Frame: 60-0D-01-00-32-02-21-74-00-0C-49-30-00-00-00-00-00-00-C3-00-78
    Jun 18 02:25:01 raspberrypi mono[477]: 02:25:01:6291:[Z-Wave]->Payload1: 32-02-21-74-00-0C-49-30-00-00-00-00-00-00-C3-00-78

    Is this how it should be? Can I do something about the excessive logging?
    Everything is Homeseer information that is logged.

    Tried to add StandardOutput=null and StandardError=null in the systemd override file for homeseer.service - but that didn't do anything to help me. Also tried to stop logging in Homeseer, but that only stopped Homeseer from being able to see the log. The daemon.log and syslog still filled up with the same information even if Homeseer couldn't see it after disabling the log.

    Why is this?

    I'd be very happy if someone could give me a hint so that I can get the system a bit more healthy. It's lagging right now.
    Looking at the processor usage, mono is constantly at 10% basically. Quite a lot isn't it?

    Thanks in advance!

    /Peter

    #2
    By default, systemd routes standard output and standard error streams to syslog. HSConsole logs to standard output, which is what you're seeing.

    Adding
    Code:
    StandardOutput=null
    in the [Service] section of the unit file should work. Are you sure you put this in the right section? Did you restart the service after editing?

    Here's my unit file
    Code:
    [Unit]
    Description=HomeSeer Home Automation
    Documentation=https://homeseer.com/support-home/
    After=network-online.target remote-fs.target time-sync.target
    Before=multi-user.target
    
    [Service]
    WorkingDirectory=/usr/local/HomeSeer
    ExecStart=/usr/bin/mono HSConsole.exe --log
    SyslogIdentifier=HSConsole
    StandardOutput=null
    Restart=on-failure
    RestartSec=30
    KillMode=none
    TimeoutStopSec=300
    ExecStop=/usr/local/HomeSeer/hsstop.sh
    
    [Install]
    WantedBy=multi-user.target

    Comment


      #3
      Thanks alot for your time, zwolfpack !

      And thank you for the brief explanation.
      Hmm.. Well - I tried to modify and got an access denied message. Read about it, and it said that I could create an override configuration which will be situated in a folder underneath /etc/systemd/system/ and will be called ./homeseer.service.d/

      In this directory the new configuration file will be created, called override.conf.
      This file contains the following;

      Code:
      [service]
      StandardOutput=null
      StandardError=null
      My regular unit file (homeseer.service) looks like this;

      Code:
      [Unit]
      Description=HomeSeer HS3 Home Automation Server
      After=network.target
      
      [Service]
      WorkingDirectory=/opt/HomeSeer
      ExecStart=/usr/bin/mono /opt/HomeSeer/HSConsole.exe --log
      ExecStop=/opt/HomeSeer/stop_homeseer.sh
      Restart=on-failure
      TimeoutStopSec=90
      
      [Install]
      WantedBy=multi-user.target
      And - unfortunately I don't know how to change it.
      Tried: sudo visudo homeseer.service
      and it got me to change the file, but it refused to owerwrite the old file. I only got to create a new file..

      Comment


        #4
        Oh oh oh!!
        Just noticed.. case sensitivity!
        Changed from [service] to [Service] in the override.service -file, restarted HomeSeer, and now everything seems to be a bit more happy with my configuration!!

        Thanks for some pointers in the right direction!

        /Peter

        Comment

        Working...
        X