haraka / Haraka

A fast, highly extensible, and event driven SMTP server
https://haraka.github.io
MIT License
5.09k stars 661 forks source link

New loglevel "emerg" is invalid #2127

Closed tknecht closed 7 years ago

tknecht commented 7 years ago

system info

Docker Base Image: node:alpine
Haraka | Haraka.js — Version: 2.8.15
 --- | :---
Node | v8.5.0
OS | Linux haraka-alpine-1 4.4.0-96-generic #119-Ubuntu SMP Tue Sep 12 14:59:54 UTC 2017 x86_64 Linux
openssl | OpenSSL 1.0.2k  26 Jan 2017

Expected behavior

If "emerg" is a loglevel it should not fail when used.

Observed behavior

When setting loglevel to "emerg" in log.ini the following happens in Haraka:

loglevel: EMERG
[DEBUG] [-] [core] Returning boolean false for main.timestamps=false
invalid loglevel: emerg defaulting to LOGWARN
log format: DEFAULT

Steps to reproduce

log.ini

[main]

; level=data, protocol, debug, info, notice, warn, error, crit, alert, emerg
level=emerg

; prepend timestamps to log entries? This setting does NOT affect logs emitted
; by logging plugins (like syslog).
timestamps=false

;  format=default, logfmt
format=default
KingNoosh commented 7 years ago

You're lucky I just faced this issue the moment you posted it, I'm putting in a PR now

tknecht commented 7 years ago

he he good timing. ;)

Not a big issues, but should be fixed at least for cosmetics :) Thanks.

KingNoosh commented 7 years ago

I fixed it in https://github.com/haraka/Haraka/pull/2128, I'm going to finish off the PR when I get home though. ;)