Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Iobroker Logging zu syslog

    NEWS

    • 15. 05. Wartungsarbeiten am ioBroker Forum

    • Monatsrückblick - April 2025

    • Minor js-controller 7.0.7 Update in latest repo

    Iobroker Logging zu syslog

    This topic has been deleted. Only users with topic management privileges can see it.
    • apollon77
      apollon77 last edited by

      Hey All,

      ich habe heute rausgefunden das syslog schon eingebaut ist und mit zwei Kleinigkeiten direkt nutzbar ist:

      1.) cd /opt/iobroker/node_modules/iobroker.js-controller/

      2.) npm install winston-syslog

      3.) Editieren von /opt/iobroker/iobroker-data/iobroker.json

      Da ist ein Abschnitt "transport" wo der zweite Unterientrag Syslog ist. Dort "enabled" auf "true" setzen und die anderen Werte wie man es braucht

      Und jetzt noch dafür sorgen das der eingetragene Host auch Syslog im entsprechenden Protokoll empfangen kann und fertig 🙂

      Vllt hilft es ja jemandem 🙂

      Ingo F

      1 Reply Last reply Reply Quote 2
      • Bluefox
        Bluefox last edited by

        Ich denke, dass winston-syslog sollte man in /opt/iobroker installieren. Sonst verschwindet das Modul nach js-Controller update

        1 Reply Last reply Reply Quote 0
        • apollon77
          apollon77 last edited by

          Was spricht dagegen es offiziell mit zu installieren mit den dependecies vom js-controller?!

          1 Reply Last reply Reply Quote 0
          • Bluefox
            Bluefox last edited by

            @apollon77:

            Was spricht dagegen es offiziell mit zu installieren mit den dependecies vom js-controller?! `
            Ich glaube nichts. Damals, dachte ich, dass da Fehlermeldungen wegen node-gyp kommen werden , aber jetzt sowieso letsencrypt dabei ist und produziert jede Menge Fehler.

            1 Reply Last reply Reply Quote 0
            • apollon77
              apollon77 last edited by

              😉

              Dann wäre offizieller support schon cool denke ich

              1 Reply Last reply Reply Quote 0
              • C
                cybertron last edited by

                Koennte mal jemand den Bereich aus der iobroker.json als ausgefülltes Beispiel posten?

                Ich wuerde das Ganze gern auf einen im Netz ohnehin vorhanden syslog-Server schicken.

                Danke & Gruss

                Silvio

                1 Reply Last reply Reply Quote 0
                • apollon77
                  apollon77 last edited by

                  Siehe https://github.com/ioBroker/ioBroker.js … -dist.json

                  Ist an sich alles drin.

                  Musst nur log -> transport -> syslog1 das "enabled": true machen und unter "Host" den Server eintragen wenn nicht localhost

                  1 Reply Last reply Reply Quote 0
                  • sissiwup
                    sissiwup last edited by

                    Hallo,

                    bei mir passiert da nix. Hat das schon wer zum laufen bekommen?

                    Habe die CCU2 und div. andere Logs auf meinen Log-Server liegen,

                    ioBroker will aber nicht.

                     "log": {
                        "level": "info",
                        "maxDays": 30,
                        "transport": {
                          "file1": {
                            "type": "file",
                            "enabled": true,
                            "filename": "log/iobroker",
                            "fileext": ".log",
                            "maxsize": null,
                            "maxFiles": null
                          },
                          "syslog1": {
                                    "type":                 "syslog",
                                    "enabled":              true,
                    
                                    "host":                 "192.168.1.13",
                                    "host_comment":         "The host running syslogd, defaults to localhost.",
                    
                                    "port_comment":         "The port on the host that syslog is running on, defaults to syslogd's default port(514/UD
                    P).",
                    
                                    "protocol":             "udp4",
                                    "protocol_comment":     "The network protocol to log over (e.g. tcp4, udp4, unix, unix-connect, etc).",
                    
                                    "path_comment":         "The path to the syslog dgram socket (i.e. /dev/log or /var/run/syslog for OS X).",
                                    "facility_comment":     "Syslog facility to use (Default: local0).",
                                    "localhost":            "iobroker",
                                    "localhost_comment":    "Host to indicate that log messages are coming from (Default: localhost).",
                                    "sysLogType_comment":   "The type of the syslog protocol to use (Default: BSD).",
                                    "app_name_comment":     "The name of the application (Default: process.title).",
                                    "eol_comment":          "The end of line character to be added to the end of the message (Default: Message without
                     modifications)."
                                }
                        }
                    
                    
                    1 Reply Last reply Reply Quote 0
                    • sissiwup
                      sissiwup last edited by

                      da fehlte noch was, jetzt gehts bei mir:

                            "syslog1": {
                                      "type":                 "syslog",
                                      "enabled":              true,
                      
                                      "host":                 "192.168.1.13",
                                      "host_comment":         "The host running syslogd, defaults to localhost.",
                                      "port":                 "514",
                                      "port_comment":         "The port on the host that syslog is running on, defaults to syslogd's default port(514/UDP).",
                      
                                      "protocol":             "udp4",
                                      "protocol_comment":     "The network protocol to log over (e.g. tcp4, udp4, unix, unix-connect, etc).",
                                      "path":                 "",
                                      "path_comment":         "The path to the syslog dgram socket (i.e. /dev/log or /var/run/syslog for OS X).",
                                      "facility_comment":     "Syslog facility to use (Default: local0).",
                                      "localhost":            "iobroker",
                                      "localhost_comment":    "Host to indicate that log messages are coming from (Default: localhost).",
                                      "sysLogType_comment":   "The type of the syslog protocol to use (Default: BSD).",
                                      "app_name_comment":     "The name of the application (Default: process.title).",
                                      "eol_comment":          "The end of line character to be added to the end of the message (Default: Message without modifications)."
                                  }
                      
                      
                      1 Reply Last reply Reply Quote 0
                      • sissiwup
                        sissiwup last edited by

                          "syslog1": {
                                        "type":                 "syslog",
                                        "enabled":              true,
                        
                                        "host":                 "192.168.1.13",
                                        "host_comment":         "The host running syslogd, defaults to localhost.",
                                        "port":                 "514",
                                        "port_comment":         "The port on the host that syslog is running on, defaults to syslogd's default port(514/UDP).",
                                        "pid":                  "0",
                                        "protocol":             "udp4",
                                        "protocol_comment":     "The network protocol to log over (e.g. tcp4, udp4, unix, unix-connect, etc).",
                                        "path":                 "",
                                        "path_comment":         "The path to the syslog dgram socket (i.e. /dev/log or /var/run/syslog for OS X).",
                                        "facility_comment":     "Syslog facility to use (Default: local0).",
                                        "localhost":            "iobroker",
                                        "localhost_comment":    "Host to indicate that log messages are coming from (Default: localhost).",
                                        "sysLogType_comment":   "The type of the syslog protocol to use (Default: BSD).",
                                        "app_name_comment":     "The name of the application (Default: process.title).",
                                        "eol_comment":          "The end of line character to be added to the end of the message (Default: Message without modifications)."
                                    }
                        
                        

                        Mit "pid" = 0 erreicht man, das die Prozess-ID nicht mit im Namen geloggt wird, das stört oft beim Filtern.

                        1 Reply Last reply Reply Quote 0
                        • sissiwup
                          sissiwup last edited by

                          Kann es sein dass

                          process.title nur vom js-controller verwendet wird und nicht von den Adaptern?

                          Wie kann ich adapter.appName oder ähnliches übergeben?

                          1 Reply Last reply Reply Quote 0
                          • sissiwup
                            sissiwup last edited by

                            Hallo,

                            das "pid = 0" kann man entfernen wenn man seinen Logging Server beibringt pid und syslogtag zu trennen:

                            /etc/rsyslog.d/mysql.conf

                            ### Configuration file for rsyslog-mysql
                            ### Changes are preserved
                            $template dbFormat,"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag, processid) values ('%msg%', %syslogfacility%, '%HOSTNAME%
                            ', %syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag:R,ERE,1,FIELD:([a-zA-Z\/]+)([[0-9]{1,5}])*:--end%', '%syslogtag:R,ERE,1,BLANK:[([0-9]{1,5})
                            ]--end%')",sql
                            
                            $ModLoad ommysql
                            *.* :ommysql:localhost,Syslog,rsyslog-mysql,PASSWORT;dbFormat
                            
                            

                            Mysql-User:

                            User: rsyslog-mysql

                            Passwort: PASSWORT

                            1 Reply Last reply Reply Quote 0
                            • wendy2702
                              wendy2702 last edited by

                              Damit ich das richtig verstehe:

                              Bedeutet das iobroker.log wird zusätzlich in Linux SYSLOG geschrieben?

                              1 Reply Last reply Reply Quote 0
                              • nieIP
                                nieIP last edited by

                                Hallo

                                ich würde das gern morgen mal testen. Wie ist der aktuelle Stand …

                                Muss ich

                                 npm install winston-syslog
                                

                                noch ausführen, oder ist das default schon mit installiert?

                                Der Beitrag ist ja schon 2 Jahre alt, daher die Nachfrage.

                                1 Reply Last reply Reply Quote 0
                                • apollon77
                                  apollon77 last edited by

                                  winston-syslog ist ein optionale dep … musst mal schauen ob es installiert ist oder du es manuell machen musst

                                  1 Reply Last reply Reply Quote 0
                                  • P
                                    pid5be0 last edited by

                                    Moin moin…

                                    Da mich das Thema ebenfalls interessiert, wollte ich den Winston-Syslog-Service ebenfalls installieren.

                                    Dabei erhielt ich diese Ausgabe. Kann es sein, das ich die Installation nicht von der ROOT des Hosts machen kann?

                                    root@debian-iobroker:~# npm install winston-syslog
                                    
                                    > unix-dgram@0.2.3 install /root/node_modules/unix-dgram
                                    > node-gyp rebuild
                                    
                                    make: Entering directory '/root/node_modules/unix-dgram/build'
                                      CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
                                      SOLINK_MODULE(target) Release/obj.target/unix_dgram.node
                                      COPY Release/unix_dgram.node
                                    make: Leaving directory '/root/node_modules/unix-dgram/build'
                                    npm WARN saveError ENOENT: no such file or directory, open '/root/package.json'
                                    npm notice created a lockfile as package-lock.json. You should commit this file.
                                    npm WARN enoent ENOENT: no such file or directory, open '/root/package.json'
                                    npm WARN root No description
                                    npm WARN root No repository field.
                                    npm WARN root No README data
                                    npm WARN root No license field.
                                    
                                    + winston-syslog@2.0.0
                                    added 6 packages from 18 contributors and audited 6 packages in 11.999s
                                    found 0 vulnerabilities
                                    
                                    root@debian-iobroker:~#
                                    

                                    Grüße,

                                    Daniel

                                    1 Reply Last reply Reply Quote 0
                                    • P
                                      pid5be0 last edited by

                                      Habe mal die Installation vom iobroker Verzeichnis gemacht.

                                      ` > root@debian-iobroker:/opt/iobroker# npm install winston-syslog

                                      • winston-syslog@2.0.0

                                      added 1 package from 2 contributors, updated 1 package and audited 4794 packages in 39.864s

                                      found 52 vulnerabilities (38 low, 14 high)

                                      run npm audit fix to fix them, or npm audit for details

                                      root@debian-iobroker:/opt/iobroker# npm audit

                                      npm ERR! code ELOCKVERIFY

                                      npm ERR! Errors were found in your package-lock.json, run npm install to fix them.

                                      npm ERR! Missing: iobroker.flot@^1.9.2

                                      npm ERR! Missing: iobroker.fritzbox@^0.2.1

                                      npm ERR! Missing: iobroker.geofency@^0.3.2

                                      npm ERR! Invalid: lock file's iobroker.hm-rega@2.0.1 does not satisfy iobroker.hm-rega@^2.1.2

                                      npm ERR! Invalid: lock file's iobroker.hm-rpc@1.8.3 does not satisfy iobroker.hm-rpc@^1.9.1

                                      npm ERR! Invalid: lock file's iobroker.iot@0.2.2 does not satisfy iobroker.iot@^0.3.1

                                      npm ERR! Invalid: lock file's iobroker.shelly@2.0.2 does not satisfy iobroker.shelly@^2.0.5

                                      npm ERR! Missing: iobroker.simple-api@^2.0.0

                                      npm ERR! Missing: iobroker.sql@^1.9.2

                                      npm ERR! Invalid: lock file's iobroker.type-detector@0.1.0 does not satisfy iobroker.type-detector@file:node_modules/iobroker.type-detector

                                      npm ERR! Missing: iobroker.unifi@^0.3.1

                                      npm ERR! Missing: iobroker.web@^2.4.1

                                      npm ERR! Invalid: lock file's winston-syslog@1.2.6 does not satisfy winston-syslog@^2.0.0

                                      npm ERR! A complete log of this run can be found in:

                                      npm ERR! /root/.npm/_logs/2019-01-14T05_26_12_350Z-debug.log `

                                      @pid5be0:

                                      Moin moin…

                                      Da mich das Thema ebenfalls interessiert, wollte ich den Winston-Syslog-Service ebenfalls installieren.

                                      Dabei erhielt ich diese Ausgabe. Kann es sein, das ich die Installation nicht von der ROOT des Hosts machen kann?

                                      root@debian-iobroker:~# npm install winston-syslog
                                      
                                      > unix-dgram@0.2.3 install /root/node_modules/unix-dgram
                                      > node-gyp rebuild
                                      
                                      make: Entering directory '/root/node_modules/unix-dgram/build'
                                        CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
                                        SOLINK_MODULE(target) Release/obj.target/unix_dgram.node
                                        COPY Release/unix_dgram.node
                                      make: Leaving directory '/root/node_modules/unix-dgram/build'
                                      npm WARN saveError ENOENT: no such file or directory, open '/root/package.json'
                                      npm notice created a lockfile as package-lock.json. You should commit this file.
                                      npm WARN enoent ENOENT: no such file or directory, open '/root/package.json'
                                      npm WARN root No description
                                      npm WARN root No repository field.
                                      npm WARN root No README data
                                      npm WARN root No license field.
                                      
                                      + winston-syslog@2.0.0
                                      added 6 packages from 18 contributors and audited 6 packages in 11.999s
                                      found 0 vulnerabilities
                                      
                                      root@debian-iobroker:~#
                                      

                                      Grüße,

                                      Daniel `

                                      1 Reply Last reply Reply Quote 0
                                      • apollon77
                                        apollon77 last edited by

                                        Das sieht erstmal ok aus. Ich weiß nur nicht mehr aus dem Kopf ob die 2.0.0 geht oder ob man aktuell die letzte 1.x von der Winston-syslog nehmen muss.

                                        Starte iobroker mal neu und konfiguriere es. Dann siehst du es ja

                                        Gesendet vom Handy …

                                        1 Reply Last reply Reply Quote 0
                                        • nieIP
                                          nieIP last edited by

                                          Hallo

                                          ich habe winston-syslog in /opt/iobroker nach installiert und mich bei der Konfig nach dem obrigen Beispiel gerichtet.

                                          Hat sofort funktioniert.

                                          Danke

                                          1 Reply Last reply Reply Quote 0
                                          • M
                                            MrLee last edited by

                                            Moin!

                                            Genial!!!! Vielen Dank für den Tipp!
                                            Kann ich nur jedem empfehlen der eh eine Syno mit ProtokollCenter laufen hat.

                                            Installation auf beiden Systemen völlig stressfrei.

                                            bis denne
                                            Mr.Lee

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate
                                            FAQ Cloud / IOT
                                            HowTo: Node.js-Update
                                            HowTo: Backup/Restore
                                            Downloads
                                            BLOG

                                            883
                                            Online

                                            31.6k
                                            Users

                                            79.4k
                                            Topics

                                            1.3m
                                            Posts

                                            11
                                            26
                                            5056
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo