# \[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:** 16

<div class="post-metadata">

**Author:** ![HvN](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hvn/32/56789_2.png) [@HvN](https://community.homey.app/u/HvN)\
**Post date:** [July 26, 2023, 12:31pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/306 "2023-07-26T12:31:27Z")

</div>

Hi @Arie_J_Godschalk,

When I try to export to a CSV or Excel file the Simple (Sys) LOG app crashes.

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

I’m running on app version v3.0.33.

Best Regards, Hugo

---

<div class="post-metadata">

**Author:** ![HvN](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hvn/32/56789_2.png) [@HvN](https://community.homey.app/u/HvN)\
**Post date:** [July 26, 2023, 12:40pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/307 "2023-07-26T12:40:43Z")

</div>

Hi @Arie_J_Godschalk ,

Is it possible to add some extra functionality to the Simple (Sys) LOG app?  
I use the search on messages very often, which works very great.

It would be very nice if it would also be possible to use some “AND, OR” statements in the search field too.  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/b/9b5baf99ab5ff71f76eb635ad1f88de29f51755d.png)  
Filtering on the right message results becomes even better/easier then.

Many thanks!

Best Regards, Hugo

---

<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:** [July 26, 2023, 1:37pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/308 "2023-07-26T13:37:45Z")

</div>

How many log entries do exist when exporting? I think it should be below 10,000 entries

---

<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:** [July 26, 2023, 1:58pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/309 "2023-07-26T13:58:24Z")

</div>

Ah great! That made my csv conversion work. The ‘logs’ part was messing things up but I couldn’t find a fix

```auto
// define url
const url = "http://192.168.1.223/api/app/nl.nielsdeklerk.log/";
// get data
let data1 = await fetch(url);
// make it json
let dataJson = await data1.json();
const table = dataJson.logs;
//console.log(table);

const replacer = (key, value) => value === null ? '-' : value // specify how you want to handle null values here
const header = Object.keys(table[0])
const csv = [
  header.join(','), // header row first
  ...table.map(row => header.map(fieldName => JSON.stringify(row[fieldName], replacer)).join(','))
].join('\r\n')

console.log(csv);

```

 ![Screenshot from 2023-07-26 15-56-43](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/1/01d60d3bb6959e635fddcb58e0f3be8e4c355553.png)

For me even more convenience: push a button and have it mailed to me:

 ![Screenshot from 2023-07-26 16-28-15](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/5/65bd5ae207860997c076c035c916ebc27db4806f.png)

---

<div class="post-metadata">

**Author:** ![HvN](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hvn/32/56789_2.png) [@HvN](https://community.homey.app/u/HvN)\
**Post date:** [July 26, 2023, 4:24pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/310 "2023-07-26T16:24:41Z")

</div>

Hi Peter,

Far beyond the 10k entries (31.695). It would be possible that this is an issue. But I do not prefer to delete my messages now. Hopefully, there is a solution to still export them.

---

<div class="post-metadata">

**Author:** ![To\_Lou](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/to_lou/32/79159_2.png) [@To\_Lou](https://community.homey.app/u/To_Lou)\
**Post date:** [July 26, 2023, 8:47pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/311 "2023-07-26T20:47:37Z")

</div>

Here’s my attempt at creating a html page to present the syslog API in a readable way.

Problem still left is that I cannot seem to get variable loaded with latest data from the Homey. For now there’s a constant set with a hardcoded JSON array.

I’m stuck basically.

So, if someone more familiar with HTML coding could get this going I would be happy.  
😇

```auto
<!DOCTYPE html>
<html>
<head>
    <style>
        table, th, td 
        {
            border: solid 1px #ddd;
            border-collapse: collapse;
            padding: 2px 3px;
            text-align: center;
        }
        th { 
            font-weight:bold;
        }
    </style>
</head>
<body>
    <input type='button' onclick='tableFromJson()' value='Create Table from JSON data' />
    <p id="showData"></p>

</body>

<script>
  let tableFromJson = () => {
    // the json data.
    const response = [
      {"logs":[{"id":"2023/07/25$26","timestamp":"2023-07-25T13:03:42.752Z","severity":5,"facility":17,"app":"Contact","message":"Entrance Contact alarm from Ytterdörr "},{"id":"2023/07/25$25","timestamp":"2023-07-25T10:40:23.076Z","severity":6,"facility":1,"app":"Garage","message":"Garage2 stängdes efter 37 sec."},{"id":"2023/07/25$24","timestamp":"2023-07-25T10:38:44.489Z","severity":5,"facility":1,"app":"Garage","message":"Garage2 styrd Remotely."},{"id":"2023/07/25$23","timestamp":"2023-07-25T10:36:34.542Z","severity":6,"facility":1,"app":"Garage","message":"Garage2 stängdes efter 10 sec."},{"id":"2023/07/25$22","timestamp":"2023-07-25T10:36:34.527Z","severity":5,"facility":1,"app":"Garage","message":"Garage2 styrd Remotely."},{"id":"2023/07/25$21","timestamp":"2023-07-25T10:36:24.233Z","severity":5,"facility":1,"app":"Garage","message":"Garage2 styrd Remotely."},{"id":"2023/07/25$20","timestamp":"2023-07-25T10:35:47.249Z","severity":5,"facility":1,"app":"Garage","message":"Garage2 styrd Remotely."},{"id":"2023/07/25$19","timestamp":"2023-07-25T10:34:35.300Z","severity":5,"facility":1,"app":"Garage","message":"Garage2 styrd Remotely."}],"count":8}
    ]

//const url = "http://192.168.1.223/api/app/nl.nielsdeklerk.log/";
//let data= await fetch(url);

//response = await data.json();

//var myBooks = response.logs;

const myBooks = response[0].logs;

    // Extract value from table header. 

    let col = [];
    for (let i = 0; i < myBooks.length; i++) {
      for (let key in myBooks[i]) {
        if (col.indexOf(key) === -1) {
          col.push(key);
        }
      }
    }

    // Create table.
    const table = document.createElement("table");

    // Create table header row using the extracted headers above.
    let tr = table.insertRow(-1); // table row.

    for (let i = 0; i < col.length; i++) {
      let th = document.createElement("th"); // table header.
      th.innerHTML = col[i];
      tr.appendChild(th);
    }

    // add json data to the table as rows.
    for (let i = 0; i < myBooks.length; i++) {

      tr = table.insertRow(-1);

      for (let j = 0; j < col.length; j++) {
        let tabCell = tr.insertCell(-1);
        tabCell.innerHTML = myBooks[i][col[j]];
      }
    }

    // Now, add the newly created table with json data, to a container.
    const divShowData = document.getElementById('showData');
    divShowData.innerHTML = "";
    divShowData.appendChild(table);

  }
</script>
</html>

```

---

<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:** [July 26, 2023, 9:19pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/312 "2023-07-26T21:19:50Z")

</div>

> [@HvN](#):
>
> Far beyond the 10k entries (31.695)

Hmmmm I recall having a similar problem, Arie asked to clear up the logs and keep 2 days or 1 day (back then the number of lines were not available). After that, the export succeeded.  
My guess is Homey memory system can’t handle that amount of data.

Maybe Arie can make exporting a selection possible one day, while I can imagine you don’t want to lose your logs, but want to shrink the log on Homey.  
Like, “export today’s logs”, or export “yesterdays logs” etcetera.

---

<div class="post-metadata">

**Author:** ![HvN](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hvn/32/56789_2.png) [@HvN](https://community.homey.app/u/HvN)\
**Post date:** [July 27, 2023, 7:01am UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/313 "2023-07-27T07:01:48Z")

</div>

Yeah that would be very nice. It would also very helpful to have an option to delete specific message based on part of the messages text for example (search/delete based on specific advance criteria in flows). @Arie_J_Godschalk

---

<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:** [July 27, 2023, 7:08am UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/314 "2023-07-27T07:08:06Z")

</div>

> [@HvN](#):
>
> Is it possible to add some extra functionality to the Simple (Sys) LOG app?

Sure, please create a feature ticket on the support site. Thanks!

---

<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:** [July 27, 2023, 7:09am UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/315 "2023-07-27T07:09:11Z")

</div>

> [@HvN](#):
>
> Far beyond the 10k entries (31.695)

Which Homey do you have? Hp2023? Or previous model?

---

<div class="post-metadata">

**Author:** ![HvN](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hvn/32/56789_2.png) [@HvN](https://community.homey.app/u/HvN)\
**Post date:** [July 27, 2023, 8:25am UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/316 "2023-07-27T08:25:56Z")

</div>

Where can I find the support site for Simple (Sys) Log?

---

<div class="post-metadata">

**Author:** ![HvN](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hvn/32/56789_2.png) [@HvN](https://community.homey.app/u/HvN)\
**Post date:** [July 27, 2023, 8:26am UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/317 "2023-07-27T08:26:26Z")

</div>

HP2023 indeed.

---

<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:** [July 27, 2023, 8:37am UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/318 "2023-07-27T08:37:45Z")

</div>

The link is in the top posts of my topics:  
[https://bitbucket.org/QlusterIT/nl.qluster-it.simplelog/issues?status=new&status=open](https://bitbucket.org/QlusterIT/nl.qluster-it.simplelog/issues?status=new&status=open)

---

<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:** [July 27, 2023, 12:19pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/319 "2023-07-27T12:19:41Z")

</div>

> [@HvN](#):
>
> Far beyond the 10k entries (31.695)

Well, on the HP2023, i have been able to generate excel files with over 150.000 lines, so that should not be the issue.  
However, before i can fix this, i first am waiting for the HP2023 to function more properly (then the last time i migrated), and i am currently updating the Device Capabilities app to the new homey-api.  
This takes up all my homey-time atm, and next week i have another holiday.

So, yes i will fix this, but i don’t expect to be able to fix it within the next 1,5 to 2 weeks. Sorry.

---

<div class="post-metadata">

**Author:** ![HvN](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hvn/32/56789_2.png) [@HvN](https://community.homey.app/u/HvN)\
**Post date:** [July 27, 2023, 12:40pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/320 "2023-07-27T12:40:24Z")

</div>

No problem, I completely understand. We are very happy with your great apps and all the work you put into it (very appreciated). Hope you have a great holiday!

---

<div class="post-metadata">

**Author:** ![To\_Lou](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/to_lou/32/79159_2.png) [@To\_Lou](https://community.homey.app/u/To_Lou)\
**Post date:** [July 28, 2023, 4:56pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/321 "2023-07-28T16:56:17Z")

</div>

HTML page ready!

Here you can check Syslog on the fly (while at home).  
Just change the Homey IP address in the URL…

Save this code to a HTML file and save on eg. your Home screen on you phone.

```auto
<!DOCTYPE html>
<html>
<head>
    <style>
        table, th, td 
        {
            border: solid 1px #ddd;
            border-collapse: collapse;
            padding: 2px 3px;
            text-align: left;
        }
        th { 
            font-weight:bold;
        }
    </style>
</head>
<body>
    
    <p id="showData"></p>

</body>

<script>

    // the json data.

const url = "http://192.168.1.223/api/app/nl.nielsdeklerk.log/";

async function FetchData() {
  const response = await fetch(url);
  const data = await response.text();
  const string = "["+data+"]";
  const myJSON = JSON.parse(string);
  const JSONtable = myJSON[0].logs;

  response.ok; // => false
  response.status; // => 404

  return JSONtable;
}

FetchData().then(JSONtable => {
  JSONtable; // => 'Page not found'

    // Extract value from table header. 

    let col = [];
    for (let i = 0; i < JSONtable.length; i++) {
      for (let key in JSONtable[i]) {
        if (col.indexOf(key) === -1) {
          col.push(key);
        }
      }
    }

    // Create table.
    const table = document.createElement("table");

    // Create table header row using the extracted headers above.
    let tr = table.insertRow(-1); // table row.

    for (let i = 0; i < col.length; i++) {
      let th = document.createElement("th"); // table header.
      th.innerHTML = col[i];
      tr.appendChild(th);
    }

    // add json data to the table as rows.
    for (let i = 0; i < JSONtable.length; i++) {

      tr = table.insertRow(-1);

      for (let j = 0; j < col.length; j++) {
        let tabCell = tr.insertCell(-1);
        tabCell.innerHTML = JSONtable[i][col[j]];
      }
    }

    // Now, add the newly created table with json data, to a container.
    const divShowData = document.getElementById('showData');
    divShowData.innerHTML = "";
    divShowData.appendChild(table);

	});
  

</script>
</html>

```

---

<div class="post-metadata">

**Author:** ![Heula](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/heula/32/31852_2.png) [@Heula](https://community.homey.app/u/Heula)\
**Post date:** [July 29, 2023, 7:55am UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/322 "2023-07-29T07:55:51Z")

</div>

For some time now I have been struggling with exporting my simple log files to my Nas.  
For some time now I have let it alone but today I thought, let’s have a look again if it will work but unfortunately it stil doesn’t work for me.

The Simple log app just crashes when I run my flow.  
Tested with all available options and with all of them it does crash. The export card works just fine and I see a log file in my destination folder. That file does contain all kind of weird text but that must be because of the card that causes the crash?

 ![Capture_982](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/5/15acd4a70118edd83bf61af5f65b4b5b839d7514.jpeg)  
 ![Capture_985](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/8/4859e66270620906f190d04b5f86b729245291ed.jpeg)  
 ![IMG_20230729_093444](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/e/ce98fd4eca7e2e82e43448b6a122ad99aecf9ff4.jpeg)

This is what is inside the csv file.

```auto
u«Z
Wš­çZ–Yh‚§Ö­j
èº”¢š™^.ˆj×¶Óm¾×o¶õ==ßÍôÛYu«Zm§djg«ëGZµí´ÛoµÛí½OOw÷}µïf
u«Z
Wš­çZ–Yh‚§Ö­j
èº”¢š™^.ˆj×¶Óm¾×o¶õ==ßÍôÛYu«Zm§djg«ëGZµí´ÛoµÛí½OOw÷}µïf

```

## b99c5d1d-e935-42c7-a4b6-905fc2a64385

Thanks.

---

<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:** [July 29, 2023, 12:19pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/323 "2023-07-29T12:19:24Z")

</div>

> [@To\_Lou](#):
>
> HTML page ready!

Wow very nice!  
~~Somehow I the ‘message’ column isn’t shown, do you have any ideas?~~ Thanks!  
**EDIT** :  
“`text-align: left`” showed my messages 🤪 There probable was a very long one somewhere, so when the columns alignments are centered, I didn’t see any at first

```auto
<html>
<head>
    <style>
        table, th, td
        {
            border: solid 1px #ddd;
            border-collapse: collapse;
            padding: 2px 3px;
            font-family: verdana;
            text-align: left;
         }
            tr:nth-child(even) {
            background-color: #D6EEEE;
            }
            tr:hover {
            background-color: #D6EEEE;
            }
        th {
            font-weight: bold;
            font-family: verdana;
            text-align: left;
        }
    </style>
</head>

```

---

<div class="post-metadata">

**Author:** ![To\_Lou](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/to_lou/32/79159_2.png) [@To\_Lou](https://community.homey.app/u/To_Lou)\
**Post date:** [July 29, 2023, 12:28pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/324 "2023-07-29T12:28:54Z")

</div>

Flip the phone to landscape?

---

<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:** [July 29, 2023, 12:37pm UTC](https://community.homey.app/t/app-pro-simple-sys-log-use-this-app-for-simple-sys-logging/77533/325 "2023-07-29T12:37:31Z")

</div>

On a laptop here 😉 but I found the ‘issue’

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

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