# \[APP\]\[Pro\] Simple (Sys) LOG - Use this app for Simple (Sys) Logging

**URL:** <https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533>\
**Category:** Apps\
**Tags:** app, tools, homey-pro, logging, syslog\
**Created:** [March 11, 2023, 8:40pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533 "2023-03-11T20:40:00Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![ChrisG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chrisg/32/8825_2.png) [@ChrisG](https://community.homey.app/u/ChrisG)\
**Post date:** [March 14, 2023, 7:34pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/41 "2023-03-14T19:34:33Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> Because there were multiple issues, can you recheck with the test version and see how things go?

I have tested the flow connection and found that the UDP transport works but for TCP I still get the error message: “Invalid frame header”.

**UDP:**

```auto
[2023-03-14T19:20:17.290251] Incoming log entry; input='<134>Mar 14 20:20:16 homey-63c568c787e41c0b8ba0db6a HP2023 via Syslog-Client\x0a', msg='0x7fd777829000', rcptid='0'
[2023-03-14T19:20:41.993704] Outgoing message; message='<134>1 2023-03-14T20:20:16+00:00 homey-63c568c787e41c0b8ba0db6a HP2023 - - - via Syslog-Client\x0a'

```

**TCP:**

```auto
[2023-03-14T19:22:49.988131] Invalid frame header; header=''

```

My TestMessage 😜:

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/2/b273d355e085a1a6b69dc4798a344a8814267a65.png)

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [March 14, 2023, 7:46pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/42 "2023-03-14T19:46:49Z")

</div>

Okay, can you perhaps create a ticket for it.  
I’ll look into it as soon as i am able.

---

<div class="post-metadata">

**Author:** ![ChrisG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chrisg/32/8825_2.png) [@ChrisG](https://community.homey.app/u/ChrisG)\
**Post date:** [March 14, 2023, 7:54pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/43 "2023-03-14T19:54:49Z")

</div>

Ok, Posted…

---

<div class="post-metadata">

**Author:** ![ChrisG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chrisg/32/8825_2.png) [@ChrisG](https://community.homey.app/u/ChrisG)\
**Post date:** [March 16, 2023, 3:55pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/44 "2023-03-16T15:55:09Z")

</div>

Hi Arie,

Have you already adapted the API so that you can send the severity, facility, etc.?

Chris

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [March 16, 2023, 4:13pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/45 "2023-03-16T16:13:52Z")

</div>

Well, No, not yet specificly.  
But i did, just now, added the aditional properties to the existing PUT /addlog/  
Also just updated the readme:

```auto
- Add log data:
  PUT /api/app/nl.nielsdeklerk.log/addlog/
  Content-Type: application/json
  {"log": "Test 1,2,3", "group": "TEST", "severity" : 6, "facility": 5, "timestamp":new Date() }

```

Its in test now.

I know there might be need for a more specific, better looking, more confirm the new model - api call, but i first wanna test what is handy in that way.

---

<div class="post-metadata">

**Author:** ![ChrisG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chrisg/32/8825_2.png) [@ChrisG](https://community.homey.app/u/ChrisG)\
**Post date:** [March 16, 2023, 4:40pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/46 "2023-03-16T16:40:26Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> I know there might be need for a more specific, better looking, more confirm the new model - api call, but i first wanna test what is handy in that way.

I’ve already thought about separating my code from myHomey library and publishing the whole thing in a separate package. Then it would be easy for the individual developers to use the interface/app in their code…

But first, the whole thing should work for me.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [March 16, 2023, 6:52pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/47 "2023-03-16T18:52:31Z")

</div>

> [@ChrisG](#):
>
> Then it would be easy for the individual developers to use the interface/app in their code…

Which one? What do you mean?  
A syslog server?

---

<div class="post-metadata">

**Author:** ![ChrisG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chrisg/32/8825_2.png) [@ChrisG](https://community.homey.app/u/ChrisG)\
**Post date:** [March 16, 2023, 7:25pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/48 "2023-03-16T19:25:22Z")

</div>

I mean a development interface (middleware) with a standardized API that internally calls SimpleLogApp and passes the logs (including syslog, of course).

This is what my API looks like at the moment, not brilliant yet but a start:

```auto
 async onInit() {
    // myHomey Logger
    this.#simpleLog = SimpleLogApp.getInstance(this)
      .on('connect', () => this.#simpleLog.connect())
      .on('disconnect', () => this.#simpleLog.disconnect());

    await this.#simpleLog.connect()
      .catch((err) => this.error(`onInit() > simpleLog > ${err}`));
  }

  // myHomey logger

  error(msg) {
    if (this.#simpleLog && this.#simpleLog.isConnected()) {
      this.#simpleLog.logError(msg);
    }
    super.error(`[ERROR] ${msg}`);
  }

  info(msg) {
    if (this.#simpleLog && this.#simpleLog.isConnected()) {
      this.#simpleLog.logInfo(msg);
    }
    super.log(`[INFO] ${msg}`);
  }

  debug(msg) {
    // Show the debug message only in debug mode.
    if (process.env.DEBUG === '1') {
      if (this.#simpleLog && this.#simpleLog.isConnected()) {
        this.#simpleLog.logDebug(msg);
      }
      super.log(`[DEBUG] ${msg}`);
    }

```

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [March 16, 2023, 7:36pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/49 "2023-03-16T19:36:25Z")

</div>

Yeah, i am building something simulare in Simple Log, thats why i registered the npm name a few weeks back.  
With that, app developers/i, can send developer logs to Simple Log.  
Than have that logging do nothing by default.  
However, users can specificly change the report-level, hit a button to write the recieved logs back into the real apps real log, so the can send a diagnostic.

That would mean i could now write a lott more logging in my apps, and users can enable and disable it themself (so to not waist resources and have apps grow), and the correct app still gets the needed data for in the diagnostic 🙂

But first have to get it out of the test fase 😉

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [March 16, 2023, 7:46pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/50 "2023-03-16T19:46:30Z")

</div>

Also, not sure if it can help, but i plan on implementing the option to create Syslog servers as devices (so you can have a TCP and a UDP running). Perhaps that can also help.  
Should not take a lot of work, since there is a very name-compatable, easy to use, extremly lightweight npm package for that: [simple-syslog-server - npm (npmjs.com)](https://www.npmjs.com/package/simple-syslog-server)

---

<div class="post-metadata">

**Author:** ![ChrisG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chrisg/32/8825_2.png) [@ChrisG](https://community.homey.app/u/ChrisG)\
**Post date:** [March 16, 2023, 8:25pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/51 "2023-03-16T20:25:33Z")

</div>

I am a log-maniac !🤪!

I log already today everything possible (and impossible). I have written/defined a logger flow with the “Advanced Trigger App” and log everything central that happens in my flows. So I only have to make the changes (e.g. for the “new” Simple (Sys) Log App) in one place.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/d/ed8f5f646eb8eef74190147e3ec27c850396f4ab.png)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/a/aa8761c45de29ffa4c0349f4c87a48f915a82113.png)

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [March 16, 2023, 8:37pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/52 "2023-03-16T20:37:42Z")

</div>

> [@ChrisG](#):
>
> I am a log-maniac !🤪!

Well perhaps your hyLogger can function as the basis to the npm package ( [simplesyslog-npm - npm (npmjs.com)](https://www.npmjs.com/package/simplesyslog-npm) yeah, wrong readme.md, it was just a placeholder 🙂

I would envision a few things tho about a includeable-npm:

- It would listen/wait for a realtime message from Simple Log before initializing for the first time.  
Keeping it low on resources enless someone wants to use it.
- Simple Log (through the App Settings) would “activate” logging for a certain app for a certain Severity.
- Only after recieving such a command should the client-app initialize.
- the npm-package should contain a (short) backlog (after the above initialisation), so on app restart or when SL is not available, it will keep the log in memory untill it can be handed of to Simple Log.
- A methode to write logs pushed back from SL into the normal stdout stderr, through its console.log etc, writing the original timestamps and severity etc. That way, a diagnostic can be send through the normal/client app, the “normal” way.
- By default, logs from client-apps should be a certain Facility, one of the “free” local slots i, on purpose, left of the select lists in SL.

---

<div class="post-metadata">

**Author:** ![ChrisG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chrisg/32/8825_2.png) [@ChrisG](https://community.homey.app/u/ChrisG)\
**Post date:** [March 16, 2023, 8:42pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/53 "2023-03-16T20:42:06Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> Also, not sure if it can help, but i plan on implementing the option to create Syslog servers as devices (so you can have a TCP and a UDP running).

No thanks, I want to use Grafana-Loki with the Syslog server, but the [(AIO) stack](https://github.com/cgHome/homelab.monitoring-stack) is still under development.

**BDW:**  
But if you agree, I’ll take a closer look at the Homey-App part, because it doesn’t make sense that we both develop the same thing and I’ve already written part of it (SimpleLogApp Wraper & Interface).

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [March 16, 2023, 10:35pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/54 "2023-03-16T22:35:36Z")

</div>

It looks like Simple Log, without creating the LOG at ones, stays very stable (even with using the App settings):

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/8/c8474b0d4fd7dbc25b30ef405f9070b55ad89504.png)

**On HP2019**

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [March 17, 2023, 7:19am UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/55 "2023-03-17T07:19:36Z")

</div>

Could you share some memory usage with me?  
Would love to know how your MB graphs are looking with Simple Log.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [March 17, 2023, 4:37pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/56 "2023-03-17T16:37:41Z")

</div>

# Update

Syslog client device has been well tested and some fixes to work better with different syslog-formats.

Also, you can now create a **Syslog Server** device, to let other devices connect to.  
I also added hostname to the Log, which you can just hide if you are not using it.

(@ChrisG 🙂 )

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [March 17, 2023, 9:38pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/57 "2023-03-17T21:38:01Z")

</div>

@Peter_Kawa , @Henk_Renting and others:  
Here is a script to remove all flowcards (and lines) from flows and advanced flows.

> [@\[APP\]\[Pro\] Simple (Sys) LOG - Use this app for Simple (Sys) Logging](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/7):
>
> Script to remove all flowcards in Flows and Advanced Flows from a certain app Use this script to remove all flowcards from a certain app from flows and advanced flows. Lines are removed too, tokens are not. Execute this in the [WebApi Playground](https://tools.developer.homey.app/tools/api-playground). Note: Work in progress. const version = '1.0.5'; //You need to run this script in the API Playground to really remove all flowcards. //const flowNames = ['AddLogCards (Test)', 'DeleteCardsFlow']; // Use this line to run a few select flows by name. …

---

<div class="post-metadata">

**Author:** ![Henk\_Renting](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henk_renting/32/87634_2.png) [@Henk\_Renting](https://community.homey.app/u/Henk_Renting)\
**Post date:** [March 17, 2023, 9:47pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/58 "2023-03-17T21:47:15Z")

</div>

How neat!  
Thanks a million!  
(and a few 🍻 to enjoy your weekend!)  
👍🏻😃

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [March 17, 2023, 10:16pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/59 "2023-03-17T22:16:19Z")

</div>

Thanks Henk, much appreciated!

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [March 17, 2023, 11:46pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/60 "2023-03-17T23:46:40Z")

</div>

Looking great Arie! 🎉 🎉  
Don’t know if I’m doing something wrong, in 2 standard flows, with an certain app’s action card in “then”, and one in “else”, they’re not getting removed.  
I’m on a Homey 2019  
Is there anything you need me to test?

This is what the test run in HS returned:  
(`const reallyExecute = false;`)

```auto
———————————————————
✅ Script Success
↩️ Returned: undefined
{
  afs: [],
  flows: [
    r {
      __athom_api_type: 'HomeyAPI.ManagerFlow.Flow',
      id: '0b37f1b1-cd6c-426e-9c1c-7a52bd28b075',
      name: 'Regen2: alert open Deur/Raam BuienAlarm Hscript',
      enabled: true,
      folder: 'b92d4d5a-926b-436c-aefc-114e4887784e',
      order: 1669,
      trigger: [Object],
      conditions: [Array],
      actions: [Array],
      broken: false,
      triggerable: true,
      triggerCount: 1154
    },
    r {
      __athom_api_type: 'HomeyAPI.ManagerFlow.Flow',
      id: '71509442-5659-4857-8b12-87aad17b99bd',
      name: 'Huidige Gasmeter stand op VD (Copy)',
      enabled: false,
      folder: '544853bd-119e-40c9-ac20-9f92fa46a0ae',
      order: 2087,
      trigger: [Object],
      conditions: [],
      actions: [Array],
      broken: false,
      triggerable: false,
      triggerCount: 0
    }
  ]
}

```

Playground console:  
(`const reallyExecute = true;`)  
 ![Screenshot from 2023-03-18 00-44-01](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/0/f04a555ac72aa6cd2ffad886587f4c4269e59d1c.png)

[Previous page](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533.md?page=2)

[Next page](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533.md?page=4)
