Display log level in text instead of corresponding integer

Author: CalebKing3Created Feb 28, 2018Updated Feb 11, 2026

Recently implemented node-bunyan on a project, and we use a variety of log.info, error and warn throughout the project.

When viewing logs, we are seeing the following. Instead of seeing level as an integer it would be more helpful to view what level that particular log was. Any assistance will go a long way.

{
    "name": "some-Service",
    "serverIp": "111111111111",
    "hostname": "some host name",
    "pid": 12345,
    "correlationId": "some id",
    "level": 50, // i want this to say debug, warn of error
    "err": {
        "message": "invalid signature",
        "name": "My error",
        "stack": "some error stack"
    },
    "msg": "invalid signature",
    "time": "2018-02-28T22:06:28.162Z",
    "src": {
        "file": "my js stuff",
        "line": 52,
        "func": "execute"
    },
    "v": 0
}