# homey-syslog

> Remote syslog logging for Homey apps

Latest version **1.1.0** (published 2017-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install homey-syslog
pnpm add homey-syslog
yarn add homey-syslog
bun add homey-syslog
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2017-12-08 |
| First published | 2017-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Robert Klep |
| Maintainers | robertklep |
| Keywords | homey, athom, syslog, home-automation, iot |

## Links

- npm: https://www.npmjs.com/package/homey-syslog
- Repository: https://github.com/robertklep/homey-syslog
- Homepage: https://github.com/robertklep/homey-syslog#readme
- Issues: https://github.com/robertklep/homey-syslog/issues
- npm.io page: https://npm.io/package/homey-syslog

## Dependencies (1)

- [syslog-client](https://npm.io/package/syslog-client.md) ^1.1.1

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2017-12-08
- 1.0.1 — 2017-12-08
- 1.0.0 — 2017-12-08

## README

# homey-syslog

A simple library to enable [Homey](https://www.athom.com/) apps to log to a remote syslog server. This requires that you have a syslog server running somewhere in your network, configured to accept external connections from syslog clients.

This library patches the built-in Homey logging code so anything that gets logged will _also_ be logged to the syslog server.

## Installation

```
$ npm i homey-syslog
```

## Usage

In your apps `app.js`:
```
require('homey-syslog')([ SYSLOG_SERVER ][, opts]);
```

`SYSLOG_SERVER` is the name or IP-address of your syslog server.

It's optional iff you provide `Homey.env.SYSLOG_HOST`, i.e. if you have a file `env.json` that defines it:

```
{ "SYSLOG_HOST" : "11.22.33.44" }
```

Valid options:
* `port` : TCP/UDP port for the syslog server. Defaults to `Homey.env.SYSLOG_PORT`, or `514` otherwise.
* `transport`: either `tcp` or `udp` (the default)
* `globalHandlers`: when `true`, will hook `uncaughtException` and `unhandledRejection` to log these errors over syslog. Defaults to `Homey.env.SYSLOG_GLOBALHANDLERS === true`.

## Example

```
require('homey-syslog')('192.168.1.123', {
  port           : 514,
  transport      : 'tcp'
  globalHandlers : true,
});
```

## DON'T USE IN PRODUCTION CODE

The purpose of this library is to aid during development of Homey apps, it's not intended to be used for apps in production.

An option could be to explicitly set a `DEBUG` environment variable in `env.json`, and only load this library when that variable evaluates to true:
```
// env.json
{ "DEBUG" : "true", "SYSLOG_HOST" : "..." }

// app.js
if (Homey.env.DEBUG === 'true') {
  require('homey-syslog')(...);
}
```

---
_Source: https://npm.io/package/homey-syslog · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
