A simple library to manage logs using winston and syslog.
📘 https://lettdigital.github.io/lett-log/docs
There is two ways to set a connection, the first one always override de second one!
import Log from 'lett-log';
const log = new Log({
host: "",
protocol: "",
port: "",
facility: "",
path: "",
appName: "",
colors: true,
timestamp: false,
});
{
"SYSLOG_HOST": "",
"SYSLOG_PROTOCOL": "",
"SYSLOG_PORT": "",
"SYSLOG_FACILITY": "",
"SYSLOG_PATH": "",
"APP_NAME": "",
"LOG_COLOR": ""
}
The
appName
orAPP_NAME
should be a CONSTANT_CASE string.
There are 4 log levels:
0 - error
1 - warn
2 - info
3 - debug
Let's explain each one:
- ❌ error: A crash application error.
- Example:
Missing required environment variable
⚠️ warn: A error with no side effects
- Example:
The image downalod failed
- ℹ️ info: Informations about application lifecycle
- Example:
Express successfully started
- 🔷 debug: Other informations meaningful
- Example:
Running query on database
Checkout the full documentation